summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANUAL.txt4
-rw-r--r--man/pandoc.18
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs8
3 files changed, 19 insertions, 1 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index d987919d9..379c61ca5 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -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
----
diff --git a/man/pandoc.1 b/man/pandoc.1
index 42a7ad10d..e02ed270e 100644
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -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
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index b3459eec0..20a478aa9 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -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)