Skip to content

Prism misparses section docs with separator #1638

@Earlopain

Description

@Earlopain

This code from https://github.com/ruby/prism/blob/7414a8c53ef3b03fae10b601834ce40965e1c1e9/templates/lib/prism/node.rb.erb#L457-L461

    # ----------------------------------------------------------------------------------
    # :section: Node Interface
    # These methods are present on all subclasses of Node.
    # Read the [node interface docs](rdoc-ref:Node@node-interface) for more information.
    # ----------------------------------------------------------------------------------

currently gets correctly rendered like this:

Image

However on main which uses prism instead of ripper I get the following:

Image

It keeps the separator and drops the last line. I tried it with only using a single line like

    # --------------------------------------------------------------------------
    # :section: Node Interface
    # FooBar
    # --------------------------------------------------------------------------

and it also keeps the separator. It also interprets it as a heading like markdown:

Image

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