Small caps in Bracketed Spans (#3191)
* Markdown reader: modify bracketedSpan to check small caps * MANUAL.txt: add description on the use of `bracketed_spans` in small cap * Improve markdown readers: bracketedSpan function EXACTLY as spanHtml
This commit is contained in:
parent
0dfcedad7e
commit
e8ce21d614
3 changed files with 19 additions and 1 deletions
|
@ -2736,6 +2736,10 @@ To write small caps, you can use an HTML span tag:
|
|||
(The semicolon is optional and there may be space after the
|
||||
colon.) This will work in all output formats that support small caps.
|
||||
|
||||
Alternatively, you can also use the new `bracketed_spans` syntax:
|
||||
|
||||
[Small caps]{style="font-variant:small-caps;"}
|
||||
|
||||
Math
|
||||
----
|
||||
|
||||
|
|
|
@ -3388,6 +3388,14 @@ To write small caps, you can use an HTML span tag:
|
|||
.PP
|
||||
(The semicolon is optional and there may be space after the colon.) This
|
||||
will work in all output formats that support small caps.
|
||||
.PP
|
||||
Alternatively, you can also use the new \f[C]bracketed_spans\f[] syntax:
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
[Small\ caps]{style="font\-variant:small\-caps;"}
|
||||
\f[]
|
||||
.fi
|
||||
.SS Math
|
||||
.SS Extension: \f[C]tex_math_dollars\f[]
|
||||
.PP
|
||||
|
|
|
@ -1764,7 +1764,13 @@ bracketedSpan = try $ do
|
|||
guardEnabled Ext_bracketed_spans
|
||||
(lab,_) <- reference
|
||||
attr <- attributes
|
||||
return $ B.spanWith attr <$> lab
|
||||
let (ident,classes,keyvals) = attr
|
||||
case lookup "style" keyvals of
|
||||
Just s | null ident && null classes &&
|
||||
map toLower (filter (`notElem` " \t;") s) ==
|
||||
"font-variant:small-caps"
|
||||
-> return $ B.smallcaps <$> lab
|
||||
_ -> return $ B.spanWith attr <$> lab
|
||||
|
||||
regLink :: (Attr -> String -> String -> Inlines -> Inlines)
|
||||
-> F Inlines -> MarkdownParser (F Inlines)
|
||||
|
|
Loading…
Reference in a new issue