mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 01:41:20 +08:00
Add support for reading & writing <mark> elements
Parse <mark> elements from HTML as HTML span like elements, with a single class matching the tag name `mark`. Mark elements are rendered to HTML using the native <mark> element. Fixes https://github.com/jgm/pandoc/issues/5797.
This commit is contained in:
committed by
John MacFarlane
parent
f1fd120d4a
commit
a933ad30fb
@@ -698,7 +698,7 @@ underlineSpan = B.spanWith ("", ["underline"], [])
|
||||
-- | Set of HTML elements that are represented as Span with a class equal as
|
||||
-- the element tag itself.
|
||||
htmlSpanLikeElements :: Set.Set T.Text
|
||||
htmlSpanLikeElements = Set.fromList [T.pack "kbd"]
|
||||
htmlSpanLikeElements = Set.fromList [T.pack "kbd", T.pack "mark"]
|
||||
|
||||
-- | Returns the first sentence in a list of inlines, and the rest.
|
||||
breakSentence :: [Inline] -> ([Inline], [Inline])
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
```
|
||||
% pandoc -f html -t html
|
||||
<mark>Ctrl-C</mark>
|
||||
^D
|
||||
<mark>Ctrl-C</mark>
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -f html -t native
|
||||
<mark>Ctrl-C</mark>
|
||||
^D
|
||||
[Plain [Span ("",["mark"],[]) [Str "Ctrl-C"]]]
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -f native -t html
|
||||
[Plain [Span ("",["mark"],[]) [Str "Ctrl-C"]]]
|
||||
^D
|
||||
<mark>Ctrl-C</mark>
|
||||
```
|
||||
Reference in New Issue
Block a user