Skip to content

Don't eat "pathless shebang lines" that could be actual Rust code #1156

Description

@timabbott

Howdy! The following syntax has surprising results with Python-Markdown, because the markdown processor tries to hide the "shebang line without path":

#!test

The feature causing this problem is https://python-markdown.github.io/extensions/code_hilite/#shebang-no-path, which attempts to create an empty code block. I think that structurally you should be able to represent anything you like inside a code block, including syntax that could be a pathless shebang line, and thus the correct solution is to either remove the "shebang-no-path" feature, or at least make it optional (probably default-off), which makes the above string not appear properly in code blocks.

See https://johnmacfarlane.net/babelmark2/?text=%60%60%60%0A%23!test%0A%60%60%60%0A for what other implementations do, and zulip/zulip#18591 for an example user experience with this feature (the original reproducer was actual Rust code).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.extensionRelated to one or more of the included extensions.needs-confirmationThe alleged behavior needs to be confirmed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions