-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Sample lua custom writer fixes (mostly editorial) #7487
Comments
PRs would be welcome for any of these! |
Of course :). What would be the preferred resolution for item 1 (attribute ordering)? Could you possibly briefly summarize what the Haskell HTML writer does? |
Attribute ordering would require changes to the way `Attr` values are
handled in the custom writer. Currently, attributes are converted into
an (unordered) Lua table, and there is no way to recover attribute
order.
I'd suggest to open a separate issue for this. It might become easier to
change once the new Lua marshalling methods are in place (#7191).
|
Thanks. I'll create a separate issue (#7489). |
These address most of the items mentioned in jgm#7487. There's also a table caption fix (the caption wasn't escaped).
PR #7493 addresses items 2-4 plus fixes another small problem that I noticed when making the changes (the table caption wasn't escaped). Comparing the built-in HTML writer with the updated sample.lua I noticed:
I mention all the above just to solicit some thoughts on whether it's worth trying to make |
These address most of the items mentioned in jgm#7487. There's also a table caption fix (the caption wasn't escaped).
These address most of the items mentioned in #7487. There's also a table caption fix (the caption wasn't escaped).
PR #7493 notes the single/double quote inconsistency and I've offered to push some more updates. Note that there are some related comments (some of which overlap) in #6729 and I'll take those into account too. Something else to check is that everything is escaped where necessary. I fixed one such case (table captions) but I suspect that there may be more. |
Should we close this issue in favour of more specific ones or new PRs? |
I can take an action to capture any outstanding items in new issues, potentially with PRs, at which point we can close this. |
I've update sample.lua to use single quotes for strings, which I believe was the last point without a separate issue. Personally I'd consider |
Here are some comments on the v2.14.1 sample lua custom writer. Please let me know if I should create separate issues for any of them.
Attribute sorting:
attributes(attr)
usespairs(attr)
, which I believe means that the attribute order is unpredictable (not a problem per se, but annoying if ever comparing the output from multiple runs). Probably it should do whatever the Haskell HTML writer does?Link attributes:
Link(s, tgt, tit, attr)
ignores theattr
argument.Image versus figure:
CaptionedImage(src, tit, caption, attr)
doesn't check for empty captions. I'm not sure about this one: I did hit it in real life, but it's possible that it was caused by a lua filter fiddling with the caption.Unintentional
head
global?Table(caption, aligns, widths, headers, rows)
can update a globalhead
variable that doesn't appear to be declared or used anywhere. Probably it can just be removed?The text was updated successfully, but these errors were encountered: