Skip to content

Conversation

@runarorama
Copy link
Contributor

@runarorama runarorama commented Sep 22, 2021

Fixes #2408

This changes the lexer and pretty-printer for doc literals slightly. Underscores are now allowed inside emphasis elements surrounded by __, as long as there are strictly fewer _ inside than around.

When pretty-printing, we print as many _ as necessary so that it's one more than the longest run of _ inside the element.

Same for ** and ~~ and ''.

This also changes the meaning of * and _ so that now any number of * means "bold" and any number of _ means "italic".

Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Left one comment for you.

* Allow ~~ to contain ~
* Make ** bold and __ italic
@runarorama runarorama added the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Sep 22, 2021
@mergify mergify bot merged commit 3997ba5 into trunk Sep 22, 2021
@mergify mergify bot deleted the topic/emphroundtrip branch September 22, 2021 19:52
@mergify mergify bot removed the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Sep 22, 2021
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.

Doc pretty print round trip issue with emphasize and underscores.

2 participants