Closed Crozzers closed 1 year ago
Looks great, thank you!
Thank you. I assume it should be mentioned here at some point, right? Especially now that a version with this feature was released. https://github.com/trentm/python-markdown2/wiki/Extras
Good shout. I've added a quick page for it here: https://github.com/trentm/python-markdown2/wiki/breaks
Looks good. I think it makes sense to link it from the Extras page I mentioned.
Updated the list of implemented extras as well
Looks like the text in the wiki contradicts the actual behavior:
<p>This line will have a line break<br />
But not this one<br />
Because the backslash has to have a space before it</p>
A space before a backslash isn't required.
Also, I created a PR with some improvements: https://github.com/trentm/python-markdown2/pull/544
Looks like the text in the wiki contradicts the actual behavior
Thanks for spotting this. Updated the wiki to reflect actual behaviour.
Also, I created a PR with some improvements
Very cool! Thank you
This PR closes #525 by adding the ability to insert hard breaks when lines end in a backslash.
The feature
By passing
extras={'breaks': {'on_backslash': True}}
, users can now use backslashes to insert hard breaks, an example of which can be found in the break_on_backslash test case.Implementation
This has been implemented via a new
breaks
extra, which contains this new functionality as well as the oldbreak-on-newline
functionality. The old extra name has been kept as an alias, so the two following examples are equivalent:This was done because I felt that having separate
break-on-*
extras was unnecessary and that grouping these similar extras made sense.