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

Improve Markdown lexer #1495

Merged
merged 10 commits into from
Jul 21, 2020
Merged

Improve Markdown lexer #1495

merged 10 commits into from
Jul 21, 2020

Conversation

Leistungsabfall
Copy link
Contributor

@Leistungsabfall Leistungsabfall commented Jul 21, 2020

This is a fix for #1492 where some fragments were only recognized when prefixed with whitespace characters.

On top of that the following improvements have been made to the Markdown lexer:

  • Added Unit Tests

  • Added rule to recognize code indented by 4 Spaces or Tab Character

  • Recognize Heading Text as Generic.Heading instead of Token.Text

  • Recognize Subheading Text as Generic.Subheading instead of Token.Text

  • Support for Setext-Style headings
    Example:

    This is a Heading
    =================
    
    Some text...
    
    This is a Subheading
    --------------------
    

    Renders like this:

    This is a Heading

    Some text...

    This is a Subheading

@birkenfeld birkenfeld requested a review from Anteru July 21, 2020 11:58
@birkenfeld
Copy link
Member

LGTM.

@Leistungsabfall
Copy link
Contributor Author

Ready for review :)

@Anteru
Copy link
Collaborator

Anteru commented Jul 21, 2020

That's a quite impressive PR, especially the comprehensive test suite is much appreciated. Looks good, queued for the next release!

@Anteru Anteru merged commit a486735 into pygments:master Jul 21, 2020
@Anteru Anteru self-assigned this Jul 21, 2020
@Anteru Anteru added the changelog-update Items which need to get mentioned in the changelog label Jul 21, 2020
@Anteru Anteru added this to the 2.7 milestone Jul 21, 2020
@Leistungsabfall Leistungsabfall deleted the improve-markdown-lexer branch July 23, 2020 12:37
@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Sep 3, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants