2011-05-29 11:17:53 +08:00
|
|
|
//
|
2011-06-28 10:11:32 +08:00
|
|
|
// Blackfriday Markdown Processor
|
|
|
|
// Available at http://github.com/russross/blackfriday
|
|
|
|
//
|
|
|
|
// Copyright © 2011 Russ Ross <russ@russross.com>.
|
2011-06-29 01:30:10 +08:00
|
|
|
// Distributed under the Simplified BSD License.
|
2011-06-28 10:11:32 +08:00
|
|
|
// See README.md for details.
|
2011-05-29 11:17:53 +08:00
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// SmartyPants rendering
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
package blackfriday
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
)
|
|
|
|
|
2011-05-30 07:00:31 +08:00
|
|
|
type smartypantsData struct {
|
|
|
|
inSingleQuote bool
|
|
|
|
inDoubleQuote bool
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
|
|
|
|
2011-05-30 07:00:31 +08:00
|
|
|
func wordBoundary(c byte) bool {
|
2011-05-29 11:17:53 +08:00
|
|
|
return c == 0 || isspace(c) || ispunct(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
func tolower(c byte) byte {
|
|
|
|
if c >= 'A' && c <= 'Z' {
|
|
|
|
return c - 'A' + 'a'
|
|
|
|
}
|
|
|
|
return c
|
|
|
|
}
|
|
|
|
|
|
|
|
func isdigit(c byte) bool {
|
|
|
|
return c >= '0' && c <= '9'
|
|
|
|
}
|
|
|
|
|
2011-07-06 04:22:21 +08:00
|
|
|
func smartQuoteHelper(out *bytes.Buffer, previousChar byte, nextChar byte, quote byte, isOpen *bool) bool {
|
2011-05-29 11:17:53 +08:00
|
|
|
// edge of the buffer is likely to be a tag that we don't get to see,
|
2011-06-23 05:40:58 +08:00
|
|
|
// so we treat it like text sometimes
|
|
|
|
|
|
|
|
// enumerate all sixteen possibilities for (previousChar, nextChar)
|
|
|
|
// each can be one of {0, space, punct, other}
|
|
|
|
switch {
|
|
|
|
case previousChar == 0 && nextChar == 0:
|
|
|
|
// context is not any help here, so toggle
|
|
|
|
*isOpen = !*isOpen
|
|
|
|
case isspace(previousChar) && nextChar == 0:
|
|
|
|
// [ "] might be [ "<code>foo...]
|
2011-05-30 07:00:31 +08:00
|
|
|
*isOpen = true
|
2011-06-23 05:40:58 +08:00
|
|
|
case ispunct(previousChar) && nextChar == 0:
|
|
|
|
// [!"] hmm... could be [Run!"] or [("<code>...]
|
|
|
|
*isOpen = false
|
|
|
|
case /* isnormal(previousChar) && */ nextChar == 0:
|
|
|
|
// [a"] is probably a close
|
|
|
|
*isOpen = false
|
|
|
|
case previousChar == 0 && isspace(nextChar):
|
|
|
|
// [" ] might be [...foo</code>" ]
|
|
|
|
*isOpen = false
|
|
|
|
case isspace(previousChar) && isspace(nextChar):
|
|
|
|
// [ " ] context is not any help here, so toggle
|
|
|
|
*isOpen = !*isOpen
|
|
|
|
case ispunct(previousChar) && isspace(nextChar):
|
|
|
|
// [!" ] is probably a close
|
2011-05-30 07:00:31 +08:00
|
|
|
*isOpen = false
|
2011-06-23 05:40:58 +08:00
|
|
|
case /* isnormal(previousChar) && */ isspace(nextChar):
|
|
|
|
// [a" ] this is one of the easy cases
|
|
|
|
*isOpen = false
|
|
|
|
case previousChar == 0 && ispunct(nextChar):
|
|
|
|
// ["!] hmm... could be ["$1.95] or [</code>"!...]
|
|
|
|
*isOpen = false
|
|
|
|
case isspace(previousChar) && ispunct(nextChar):
|
|
|
|
// [ "!] looks more like [ "$1.95]
|
2011-05-30 07:00:31 +08:00
|
|
|
*isOpen = true
|
2011-06-23 05:40:58 +08:00
|
|
|
case ispunct(previousChar) && ispunct(nextChar):
|
|
|
|
// [!"!] context is not any help here, so toggle
|
|
|
|
*isOpen = !*isOpen
|
|
|
|
case /* isnormal(previousChar) && */ ispunct(nextChar):
|
|
|
|
// [a"!] is probably a close
|
2011-05-30 07:00:31 +08:00
|
|
|
*isOpen = false
|
2011-06-23 05:40:58 +08:00
|
|
|
case previousChar == 0 /* && isnormal(nextChar) */ :
|
|
|
|
// ["a] is probably an open
|
|
|
|
*isOpen = true
|
|
|
|
case isspace(previousChar) /* && isnormal(nextChar) */ :
|
|
|
|
// [ "a] this is one of the easy cases
|
|
|
|
*isOpen = true
|
|
|
|
case ispunct(previousChar) /* && isnormal(nextChar) */ :
|
|
|
|
// [!"a] is probably an open
|
2011-05-30 07:00:31 +08:00
|
|
|
*isOpen = true
|
2011-05-29 11:17:53 +08:00
|
|
|
default:
|
2011-06-23 05:40:58 +08:00
|
|
|
// [a'b] maybe a contraction?
|
|
|
|
*isOpen = false
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte('&')
|
2011-05-30 07:00:31 +08:00
|
|
|
if *isOpen {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte('l')
|
2011-05-29 11:17:53 +08:00
|
|
|
} else {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte('r')
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(quote)
|
|
|
|
out.WriteString("quo;")
|
2011-05-29 11:17:53 +08:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2011-07-06 04:22:21 +08:00
|
|
|
func smartSingleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 2 {
|
|
|
|
t1 := tolower(text[1])
|
|
|
|
|
|
|
|
if t1 == '\'' {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar := byte(0)
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 3 {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar = text[2]
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {
|
2011-05-29 11:17:53 +08:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-30 07:00:31 +08:00
|
|
|
if (t1 == 's' || t1 == 't' || t1 == 'm' || t1 == 'd') && (len(text) < 3 || wordBoundary(text[2])) {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("’")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(text) >= 3 {
|
|
|
|
t2 := tolower(text[2])
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
if ((t1 == 'r' && t2 == 'e') || (t1 == 'l' && t2 == 'l') || (t1 == 'v' && t2 == 'e')) &&
|
|
|
|
(len(text) < 4 || wordBoundary(text[3])) {
|
|
|
|
out.WriteString("’")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar := byte(0)
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) > 1 {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar = text[1]
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
if smartQuoteHelper(out, previousChar, nextChar, 's', &smrt.inSingleQuote) {
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartParens(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 3 {
|
|
|
|
t1 := tolower(text[1])
|
|
|
|
t2 := tolower(text[2])
|
|
|
|
|
|
|
|
if t1 == 'c' && t2 == ')' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("©")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
|
|
|
if t1 == 'r' && t2 == ')' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("®")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(text) >= 4 && t1 == 't' && t2 == 'm' && text[3] == ')' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("™")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartDash(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 2 {
|
|
|
|
if text[1] == '-' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("—")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2011-05-30 07:00:31 +08:00
|
|
|
if wordBoundary(previousChar) && wordBoundary(text[1]) {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("–")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartDashLatex(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 3 && text[1] == '-' && text[2] == '-' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("—")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
if len(text) >= 2 && text[1] == '-' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("–")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartAmp(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if bytes.HasPrefix(text, []byte(""")) {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar := byte(0)
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 7 {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar = text[6]
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {
|
2011-05-29 11:17:53 +08:00
|
|
|
return 5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if bytes.HasPrefix(text, []byte("�")) {
|
|
|
|
return 3
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte('&')
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartPeriod(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 3 && text[1] == '.' && text[2] == '.' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("…")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(text) >= 5 && text[1] == ' ' && text[2] == '.' && text[3] == ' ' && text[4] == '.' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("…")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 4
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartBacktick(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 2 && text[1] == '`' {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar := byte(0)
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) >= 3 {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar = text[2]
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {
|
2011-05-29 11:17:53 +08:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartNumberGeneric(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-30 07:00:31 +08:00
|
|
|
if wordBoundary(previousChar) && len(text) >= 3 {
|
2011-05-29 11:17:53 +08:00
|
|
|
// is it of the form digits/digits(word boundary)?, i.e., \d+/\d+\b
|
2011-06-29 06:02:12 +08:00
|
|
|
numEnd := 0
|
|
|
|
for len(text) > numEnd && isdigit(text[numEnd]) {
|
|
|
|
numEnd++
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-06-29 06:02:12 +08:00
|
|
|
if numEnd == 0 {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
2011-06-29 06:02:12 +08:00
|
|
|
if len(text) < numEnd+2 || text[numEnd] != '/' {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
2011-06-29 06:02:12 +08:00
|
|
|
denEnd := numEnd + 1
|
|
|
|
for len(text) > denEnd && isdigit(text[denEnd]) {
|
|
|
|
denEnd++
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-06-29 06:02:12 +08:00
|
|
|
if denEnd == numEnd+1 {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
2011-06-29 06:02:12 +08:00
|
|
|
if len(text) == denEnd || wordBoundary(text[denEnd]) {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("<sup>")
|
|
|
|
out.Write(text[:numEnd])
|
|
|
|
out.WriteString("</sup>⁄<sub>")
|
|
|
|
out.Write(text[numEnd+1 : denEnd])
|
|
|
|
out.WriteString("</sub>")
|
2011-06-29 06:02:12 +08:00
|
|
|
return denEnd - 1
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
func smartNumber(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-30 07:00:31 +08:00
|
|
|
if wordBoundary(previousChar) && len(text) >= 3 {
|
2011-05-29 11:17:53 +08:00
|
|
|
if text[0] == '1' && text[1] == '/' && text[2] == '2' {
|
2011-05-30 07:00:31 +08:00
|
|
|
if len(text) < 4 || wordBoundary(text[3]) {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("½")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if text[0] == '1' && text[1] == '/' && text[2] == '4' {
|
2011-05-30 07:00:31 +08:00
|
|
|
if len(text) < 4 || wordBoundary(text[3]) || (len(text) >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h') {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("¼")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if text[0] == '3' && text[1] == '/' && text[2] == '4' {
|
2011-05-30 07:00:31 +08:00
|
|
|
if len(text) < 4 || wordBoundary(text[3]) || (len(text) >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's') {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString("¾")
|
2011-05-29 11:17:53 +08:00
|
|
|
return 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteByte(text[0])
|
2011-05-29 11:17:53 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-07-06 04:22:21 +08:00
|
|
|
func smartDoubleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar := byte(0)
|
2011-05-29 11:17:53 +08:00
|
|
|
if len(text) > 1 {
|
2011-05-30 07:00:31 +08:00
|
|
|
nextChar = text[1]
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
if !smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {
|
2011-06-29 09:46:35 +08:00
|
|
|
out.WriteString(""")
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2011-07-06 04:22:21 +08:00
|
|
|
func smartLeftAngle(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {
|
2011-05-29 11:17:53 +08:00
|
|
|
i := 0
|
|
|
|
|
|
|
|
for i < len(text) && text[i] != '>' {
|
|
|
|
i++
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
out.Write(text[:i+1])
|
2011-05-29 11:17:53 +08:00
|
|
|
return i
|
|
|
|
}
|
|
|
|
|
2011-06-29 09:46:35 +08:00
|
|
|
type smartCallback func(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int
|
2011-05-29 11:17:53 +08:00
|
|
|
|
2011-07-08 01:56:45 +08:00
|
|
|
type smartypantsRenderer [256]smartCallback
|
2011-05-29 11:17:53 +08:00
|
|
|
|
2011-07-08 01:56:45 +08:00
|
|
|
func smartypants(flags int) *smartypantsRenderer {
|
|
|
|
r := new(smartypantsRenderer)
|
2011-07-06 04:22:21 +08:00
|
|
|
r['"'] = smartDoubleQuote
|
2011-05-30 07:00:31 +08:00
|
|
|
r['&'] = smartAmp
|
2011-07-06 04:22:21 +08:00
|
|
|
r['\''] = smartSingleQuote
|
2011-05-30 07:00:31 +08:00
|
|
|
r['('] = smartParens
|
2011-05-29 11:17:53 +08:00
|
|
|
if flags&HTML_SMARTYPANTS_LATEX_DASHES == 0 {
|
2011-05-30 07:00:31 +08:00
|
|
|
r['-'] = smartDash
|
2011-05-29 11:17:53 +08:00
|
|
|
} else {
|
2011-05-30 07:00:31 +08:00
|
|
|
r['-'] = smartDashLatex
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
2011-05-30 07:00:31 +08:00
|
|
|
r['.'] = smartPeriod
|
2011-05-29 11:17:53 +08:00
|
|
|
if flags&HTML_SMARTYPANTS_FRACTIONS == 0 {
|
2011-05-30 07:00:31 +08:00
|
|
|
r['1'] = smartNumber
|
|
|
|
r['3'] = smartNumber
|
2011-05-29 11:17:53 +08:00
|
|
|
} else {
|
|
|
|
for ch := '1'; ch <= '9'; ch++ {
|
2011-05-30 07:00:31 +08:00
|
|
|
r[ch] = smartNumberGeneric
|
2011-05-29 11:17:53 +08:00
|
|
|
}
|
|
|
|
}
|
2011-07-06 04:22:21 +08:00
|
|
|
r['<'] = smartLeftAngle
|
2011-05-30 07:00:31 +08:00
|
|
|
r['`'] = smartBacktick
|
2011-05-29 11:17:53 +08:00
|
|
|
return r
|
|
|
|
}
|