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

Add middle-word-em extra #522

Merged
merged 3 commits into from
Jul 23, 2023
Merged

Conversation

Crozzers
Copy link
Contributor

This PR closes #38 by adding an extra to disable emphasis syntax when in the middle of a word.

The current behaviour of the library is to always convert this_text_here to this<em>text</em>here. However, this is not always desirable, as highlighted in #38.

The new middle-word-em extra will allow users to allow (default) or disallow this behaviour by passing extras={'middle-word-em': True/False}. When disabled, any emphasis will be required to have a word boundary (r'\b') surrounding it.

For backwards compatibility, I've kept the default behaviour as allowing middle word emphasis. Users must explicitly disable it. Passing extras=['middle-word-em'] will not work.

This extra will control whether emphasis in the middle of words will be allowed.
When disabled, a whitespace will be requitred on both sides of the emphasis to be considered.
The default is to allow middle word emphasis
@nicholasserra
Copy link
Collaborator

Score LGTM thank you

@nicholasserra nicholasserra merged commit 6c5fb43 into trentm:master Jul 23, 2023
18 checks passed
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.

[shadow] Annoying conversion of long_file_name to long<em>file</em>name (intra-word emphasis)
2 participants