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

use-file-vars seems to be broken #269

Open
Tachytaenius opened this issue Aug 15, 2017 · 3 comments
Open

use-file-vars seems to be broken #269

Tachytaenius opened this issue Aug 15, 2017 · 3 comments
Labels

Comments

@Tachytaenius
Copy link

data = markdown2.markdown(data, extras=["header-ids"]) lets header-ids work in the output data, in that HTML headers have their id attribute.
data = markdown2.markdown(data, extras=["use-file-vars"]) while data starts with <!-- markdown-extras: header-ids --> doesn't let header-ids work; headers are devoid of an id attribute.

I dunno what's wrong here, I'm just saying what I've seen.

@nicholasserra
Copy link
Collaborator

Having a bit of trouble following this. Can you provide input and output? Thanks for the report!

@Tachytaenius
Copy link
Author

Tachytaenius commented Aug 16, 2017

The data that is passed into the markdown2.markdown function is unprocessed markdown. Y'know, underscores and such. You presumably know enough python to understand that the data in data = markdown2... is an output HTML file.

Let data be

<!-- markdown-extras: header-ids -->
# Header

When that is passed in to markdown2.markdown(data, extras=["use-file-vars"]), the output is

Header

(I just noticed that there's an empty line after the attempt at telling the file to use header-ids. Something's happened...) There is no id attribute to the h1 tag, so header-ids hasn't worked!!

However header-ids does work if I remove the <!-- markdown-extras: header-ids --> and replace the processing function with markdown2.markdown(data, extras=["header-ids"]). So yeah, use-file-vars does basically nothing.

@nicholasserra
Copy link
Collaborator

Thank you for this extra info. I'll tear into it eventually. In the meantime if you find a fix please make a PR :)

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

No branches or pull requests

2 participants