-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the SimpleFigure
in Readers
#7611
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,12 @@ para = do | |
contents <- trimInlines . mconcat <$> many1 inline | ||
if F.all (==Space) contents | ||
then return mempty | ||
else return $ B.para contents | ||
else case B.toList contents of | ||
-- For the MediaWiki format all images are considered figures | ||
[Image attr figureCaption (src, title)] -> | ||
return $ B.simpleFigureWith | ||
attr (B.fromList figureCaption) src title | ||
Comment on lines
+205
to
+208
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate on "For the MediaWiki format all images are considered figures"? Is this a change in behavior? What motivates it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original (before I rewrote it using simple figure) code had that behavior and I kept it. I just implemented the behavior here (at lines ~205-208) |
||
_ -> return $ B.para contents | ||
|
||
table :: PandocMonad m => MWParser m Blocks | ||
table = do | ||
|
@@ -631,7 +636,7 @@ image = try $ do | |
let attr = ("", [], kvs) | ||
caption <- (B.str fname <$ sym "]]") | ||
<|> try (char '|' *> (mconcat <$> manyTill inline (sym "]]"))) | ||
return $ B.imageWith attr fname ("fig:" <> stringify caption) caption | ||
return $ B.imageWith attr fname (stringify caption) caption | ||
Comment on lines
-634
to
+639
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to the previous one this is where the "For the MediaWiki format all images are considered figures" came from. The original code used the "fig:" prefix all the time as the deleted 634 line shows. MediaWiki supports inline images: https://www.mediawiki.org/wiki/Help:Images I just kept the old behavior. (but implemented it at lines ~206) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This patch's version
pandoc 2.14.1
Notice the 'fig:' prefixing the caption. It doesn't actually create a figure So the comment should be removed\ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, thanks for clarifying, this makes sense. |
||
|
||
imageOption :: PandocMonad m => MWParser m Text | ||
imageOption = try $ char '|' *> opt | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These qualifications won't be necessary until
figure
is added to Builder, correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct