Skip to content
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

Footnote <table>s are nested in a <p> tag #936

Closed
McSinyx opened this issue Dec 26, 2021 · 2 comments
Closed

Footnote <table>s are nested in a <p> tag #936

McSinyx opened this issue Dec 26, 2021 · 2 comments

Comments

@McSinyx
Copy link
Contributor

McSinyx commented Dec 26, 2021

Semantically <p> tags should not contain <table>.

@tlienart
Copy link
Owner

tlienart commented Dec 30, 2021

There's quite a few issues opened here to do with <p> tags. Long story short Franklin is something on top of the Base.Markdown markdown to html conversion which is faulty. Franklin then bends over backwards to try to avoid having unclosed <p> blocks (which it doesn't always manage to do). The logic that does this is complicated and hard to maintain, adding extra cases to try to avoid what you flagged is not the right path.

The future version which can be previewed here https://github.com/tlienart/Xranklin.jl (though not recommended for use atm, it's work ongoing) has its own markdown to HTML converter; it's not perfect but it's better by avoiding going through the Base converter; and since it constructs the HTML in a saner manner, there are fewer issues though there will likely still be some. I've put a fair bit of effort into trying to limit the number of cases where tags are unclosed (because it's important for things like minifiers) and to keep the HTML logic correct, this is not something that's trivial to do for a number of reasons however (unless you build the HTML tree which is not what I wanted to do for a bunch of reasons) and in order not to have complicated and hard to maintain logic in the code, there will definitely be cases where the generated HTML will be properly rendered by any standard browser and yet won't be fully semantically correct.

The case you flagged (table within a paragraph) is one of the few basic erroneous cases that will go away though.

Hope that makes sense!

@McSinyx
Copy link
Contributor Author

McSinyx commented Dec 30, 2021

That's OK, I've already came up with a work around specifically for the footnotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants