diff options
| author | Shulhan <ms@kilabit.info> | 2020-12-26 17:23:03 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2020-12-26 17:23:03 +0700 |
| commit | ff8a9955a153deebe7c55b8f748b429ea157ee73 (patch) | |
| tree | 56b23d8f9f199fb40679724d2f16475d3bb9f645 /inline_parser.go | |
| parent | e39ff0f9ee29f290fcd5eedb94309db71fa78d25 (diff) | |
| download | asciidoctor-go-ff8a9955a153deebe7c55b8f748b429ea157ee73.tar.xz | |
all: replace space surrounding the em-dash with html symbol thin space
If the em-dash strings "--" flanked by space, replace the space with
HTML symbol thin space.
Diffstat (limited to 'inline_parser.go')
| -rw-r--r-- | inline_parser.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/inline_parser.go b/inline_parser.go index cf1b392..872a669 100644 --- a/inline_parser.go +++ b/inline_parser.go @@ -302,7 +302,15 @@ func (pi *inlineParser) do() { } if pi.prev != '-' { if pi.nextc == '-' && pi.nextcc != '-' { + if ascii.IsSpace(pi.prev) && ascii.IsSpace(pi.nextcc) { + pi.current.backTrimSpace() + pi.current.WriteString(htmlSymbolThinSpace) + } pi.current.WriteString(htmlSymbolEmdash) + if ascii.IsSpace(pi.nextcc) { + pi.current.WriteString(htmlSymbolThinSpace) + pi.x++ + } pi.x += 2 pi.prev = pi.nextc continue |
