-
-
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
New pipe table line width calculations yield some unnatural column widths #7847
Comments
What authors who use pipe tables have to recognize is that, if their table extends beyond the column set by
|
Okay, the new behavior does seem better specified and less surprising. My particular concern here is partly driven by the fact that we have a visual editor for Pandoc markdown that edits the JSON representation of the AST and then uses Pandoc to serialize it to and from markdown. So for this scenario the user can't manually tweak the markdown Consider my original table example ( function Table(tbl)
tbl = pandoc.utils.to_simple_table(tbl)
tbl.widths = { 0.3, 0.7 }
return pandoc.utils.from_simple_table(tbl)
end $ quarto table.md --lua-filter colwidths.lua --to markdown_strict+pipe_tables
| JATS Element | Description |
|-------------------------------------------------------------------------------------------------|----------------------------------|
| [`<given-names>`](https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/given-names.html) | All given names of a person. |
| [`<contrib>`](https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/contrib.html) | Information about a contributor. | It would be great if the 0.3 and 0.7 column widths were reflected in the widths of the Note that if I do the same render to $ pandoc table.md --lua-filter colwidths.lua --to markdown_strict+grid_tables
+--------------------+-------------------------------------------------+
| JATS Element | Description |
+====================+=================================================+
| [`<gi | All given names of a person. |
| ven-names>`](https | |
| ://jats.nlm.nih.go | |
| v/publishing/tag-l | |
| ibrary/1.2/element | |
| /given-names.html) | |
+--------------------+-------------------------------------------------+
| [`<contrib>`](h | Information about a contributor. |
| ttps://jats.nlm.ni | |
| h.gov/publishing/t | |
| ag-library/1.2/ele | |
| ment/contrib.html) | |
+--------------------+-------------------------------------------------+
|
Simple tables by definition don't have (nonzero) column widths, so that may be the issue if you're using |
You're right, the markdown writer doesn't take account of widths in writing pipe tables. If that changed, would that fix things for you? |
Yes, if the pipe table writer reflected the column widths in the AST that would indeed fix things! |
OK, I think this might be fixed by the commit I just pushed. |
Okay, that's excellent! Thank you :-) |
The change in pipe table line width detection calculation (79e6f8d) can lead to some sub-optional HTML output, especially when there are hyperlinks in one of the columns. For example, consider this markdown:
When rendered to HTML the following
<colgroup>
tag is emitted:Which results in the following display:
As the page gets narrower the problem exacerbates:
The text was updated successfully, but these errors were encountered: