-
Notifications
You must be signed in to change notification settings - Fork 433
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
make metadata fences optional #215
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So this fix just allows metadata to be included without the hyphens wrapped around it? Is it still enforced that the metadata is at the top? Looks like yes. |
Yes, hyphens become optional. The regex still searches at the top of the text. |
Thanks :D |
davidlowryduda
added a commit
to davidlowryduda/python-markdown2
that referenced
this pull request
Dec 20, 2016
The previous commit towards resolving Issue trentm#234 didn't incorporate previous behavior that fences shouldn't be necessary. First introduced in Pull Request trentm#215, metadata should be accessible even without including `---` fences around opening metadata. This fix now preserves the ability to use either `---` fences (maybe without a subsequent blank line) or no fences (but with a blank line). Resolves: trentm#234
nicholasserra
pushed a commit
that referenced
this pull request
Dec 20, 2016
* Fix metadata extra to consume only initial fenced block As noted in Issue #234 #234 the metadata extra uses regex that is too greedy and can eat more than what is intended if links appear in the markdown. This small change corrects this. Resolves: #234 * Add David Lowry-Duda as a contributor * Updated fix on metadata to work without fences The previous commit towards resolving Issue #234 didn't incorporate previous behavior that fences shouldn't be necessary. First introduced in Pull Request #215, metadata should be accessible even without including `---` fences around opening metadata. This fix now preserves the ability to use either `---` fences (maybe without a subsequent blank line) or no fences (but with a blank line). Resolves: #234
nicholasserra
pushed a commit
that referenced
this pull request
Mar 7, 2017
* Fix metadata extra to consume only initial fenced block As noted in Issue #234 #234 the metadata extra uses regex that is too greedy and can eat more than what is intended if links appear in the markdown. This small change corrects this. Resolves: #234 * Add David Lowry-Duda as a contributor * Updated fix on metadata to work without fences The previous commit towards resolving Issue #234 didn't incorporate previous behavior that fences shouldn't be necessary. First introduced in Pull Request #215, metadata should be accessible even without including `---` fences around opening metadata. This fix now preserves the ability to use either `---` fences (maybe without a subsequent blank line) or no fences (but with a blank line). Resolves: #234 * Add language support for footnotes As noted in Issue #244, it is not currently possible to customize the text used in footnotes. It is always "Jump back to footnote <number> in the text." It may be desirable to provide a programmable way to supply different text, such as in different languages. This provides that support when used from within the interpreter. Usage is markdowner = markdown2.Markdown(extras=["footnotes"]) markdowner.footnote_title = "Retournez vers footnote %d. " markdowner.convert(text) This also adds the ability to change the footnote link text, through markdowner.footnote_link_text = "<something>" because they are very similar. Resolves: #244 * Added footenoteBackLink class to footnotes * Make user-provided backlinks for custom footnotes more natural Users no longer need to include html closing tags in custom definitions for footnote_title or footnote_link_text. And naked except Exception statements have been replaced with the expected errors. These notes were made by nicholasserra in Pull Request #247 * "title=" no longer required for custom footnote title * Added ability to provide custom class variables to Markdown instance It is now possible to provide class variables to the Markdown instance in the testing library by creating a file.customargs file containing a dictionary. For example, one might have have a footnotes_customtitle test, which could be tested by making the following file. footnotes_customtitle.customargs --- {"footnote_title" : "Return to %d above"} --- When testing footnote_customtitle, the Markdown instance will be passed the variable, essentially like ``` markdowner = markdown2.Markdown(*opts) markdowner.footnote_title = "Return to %d above" text = markdowner.convert(html) ``` This was done to allow tests for #247 * Added missing quotes to footnote_titles * Added test for custom footnote_title to test suite There is now a test for custom footnote_titles in the test suite. Adds tests for: PR #247 Resolves: #244 * Change custom footnotes to function inline The behavior of custom footnote text is now implemented in the following way, as recommended in #247 ``` markdown2.markdown(text, extras=["footnotes"], footnote_title="Regresar a %d.") ``` This is in contrast to the previous implementation, which required an intermediate step defining a class variable. As the interface changed, it was necessary to rewrite the relevant test, which now defines the customization in the footnotes_custom.opts file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Markdown
package supports parsing metadata without mandatory "---"-wrapping. The fix enables to write metadata like this:so the top metadata can be separated by a single blank line.