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

Regex for horizontal rules doesn't follow Markdown.pl and PHP Markdown #22

Closed
jpfleury opened this issue Jun 15, 2011 · 0 comments
Closed
Assignees
Labels
bug Bug report. core Related to the core parser code.
Milestone

Comments

@jpfleury
Copy link

In Markdown, we can create a horizontal rule with 3 or more proper symbols (hyphens, underscores or asterisks) with 2 spaces maximum between each symbol. The following examples produce 3 horizontal rules with both Markdown.pl and PHP Markdown:

-  --  -

**  *  **

_  _  _

but Python Markdown doesn't create any horizontal rule:

<ul>
<li>--  -</li>
</ul>
<p><strong>  *  </strong></p>
<p>_  _  _</p>

For information, the regex that I use to highlight a horizontal rule in gedit is the following:

^[ ]{0,3}            # Maximum 3 spaces at the beginning of the line.
(
  (-+[ ]{0,2}){3,} | # 3 or more hyphens, with 2 spaces maximum between each hyphen.
  (_+[ ]{0,2}){3,} | # Idem, but with underscores.
  (\*+[ ]{0,2}){3,}  # Idem, but with asterisks.
)
[ \t]*$              # Optional trailing spaces or tabs.
@ghost ghost assigned waylan Jun 15, 2011
@waylan waylan closed this as completed in 619613e Jun 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report. core Related to the core parser code.
Projects
None yet
Development

No branches or pull requests

2 participants