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 does not produce valid HTML #129

Closed
posativ opened this issue Aug 6, 2012 · 3 comments
Closed

footnote does not produce valid HTML #129

posativ opened this issue Aug 6, 2012 · 3 comments

Comments

@posativ
Copy link

posativ commented Aug 6, 2012

I used the footnotes extension in my HTML5 blog and got the following from the W3 validator with my post.

Don't know why <li id="fn:1"> is generated, but this is not a valid pseudo element and should be not accessible in CSS selectors (at least SASS breaks). Pandoc produces valid output in the form of id=fn-1, but I used to use python-markdown, not an external tool.

@waylan
Copy link
Member

waylan commented Aug 7, 2012

Our output is an exact copy of PHP Markdown Extra's. Also, I believe that this does valid as HTML4 or XHTML1. Looks like you're trying to validate as HTML5 and the errors are actualy regarding depreciated use of the 'rev' and 'rel' attributes.

Regarding <li id="fn:1">, this is used so that you can click on the superscript in the body and jump down to the footnote (thus an id): http://example.com/some/page.html#fn:1. Of course, the fn:1 indicates that this is footnote number 1. Footnote number two would be 'fn:2'. As each footnote would be different, not sure why you would be using css to reference the li id's. Seems like you would want to use div.footnotes and it's children (like perhaps li:first). The point is that the id was never meant as a styling hook.

In any event, this does "look like" a pseudo element and probably should be changed. I've brought this up on the markdown list in hopes that some consistency can be reached among the various implementations. Thanks for the report.

@michelf
Copy link

michelf commented Aug 7, 2012

fn:1 is a perfectly valid id attribute. It's true that it was not meant to be a style hook and it's probably a bad idea to use it as such (because what follows fn: is a user-defined text). In any case, you can still use it as a style hook if you backlash-escape the colon in your CSS selector, if you really want to.

@posativ
Copy link
Author

posativ commented Aug 7, 2012

Okay, I see that fn:1 is fine (I ended by with li:first-child for the styling), but can we make footnotes compatible with HTML5 if possible?

waylan pushed a commit that referenced this issue Aug 9, 2012
Specificaly, `self.output_format` is defined and contains a string of the
output format used on the instance. This is more useful that an instance
of the searializer when determining alternate behavior elsewhere in the parser.
For example, see Issue #129.

Also cleaned up the error when an invalid format is provided. We now re-raise
the original error (with a custom message) rather than raising a new error.
@waylan waylan closed this as completed in 2fe5b5b Aug 9, 2012
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

3 participants