Skip to content

Improve regex to detect chars immediately after inline literals and roles #30

@ezio-melotti

Description

@ezio-melotti

From #27 (comment): some characters (such as punctuation) are allowed immediately after inline literals and roles, whereas others (alphanumerical) aren't.

The following regex could be improved to catch only the problematic characters:

for role in re.finditer("``.+?``(?!`).", paragraph_without_roles, flags=re.DOTALL):

Replacing the last . with \w seems to cause lot of false positives though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions