-
-
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
No way to split up long lines in a grid table cell #4943
Labels
Comments
I'm not really sure I see a good solution here.
Remember, the cells are parsed as block-level
markdown content. A backslash at the end of a line
already has a well-defined meaning in pandoc markdown,
as a hard line break. So making the change you
suggest could well break many other people's tables.
|
#5639 might address this as a new markdown table extension. |
There doesn't seem to be a good solution, so I'm closing this. FWIW, I've been using the Unicode "soft hyphen" character for this purpose, combined with the following Lua filter: -- Removes spaces and soft linebreaks after "SOFT HYPHEN" Unicode
-- characters. It doesn't make sense for a soft hyphen to be followed by
-- a space, so we can use it to re-join words, e.g. after wrapping them
-- to fit small table columns.
local text = require 'text'
function space_after_soft_hyphen (left, right)
return left and left.t == 'Str' and text.sub(left.text, -1) == ''
and right and (right.t == 'Space' or right.t == 'SoftBreak')
end
function Inlines (inlns)
for i = #inlns - 1, 1, -1 do
if space_after_soft_hyphen(inlns[i], inlns[i+1]) then
-- LaTeX doesn't use soft hyphens for hyphenation. Replace with
-- LaTeX specific syntax.
if FORMAT:match 'latex' then
inlns[i].text = text.sub(inlns[i].text, 1, -1)
inlns[i+1] = pandoc.RawInline('latex', '\\-')
else
inlns:remove(i+1)
end
end
end
return inlns
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The width of a table column in Markdown can be used to control the width of the rendered column.
However, if the source includes markup (for example cross-references) which are wider than the column, these are incorrectly parsed. This can be fixed by widening the column ... but then the appearance of the rendered table changes.
Here is an example, to be rendered using
Example
test.md
:The text was updated successfully, but these errors were encountered: