Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Parse pragmas in @@ blocks #1148

@Lysxia

Description

@Lysxia

The following comment

-- @
-- {-# LANGUAGE DeriveGeneric #-}
-- @

Gets interpreted as containing an anchor # LANGUAGE DeriveGeneric #, {-<a id=" LANGUAGE DeriveGeneric "></a>-}, so people will just see this in the rendered doc:

{--}

The current workaround is to escape the #:

-- @
-- {-\# LANGUAGE DeriveGeneric \#-}
-- @

The problem is that it is very easy to miss.

It would be nice to detect this situation automatically and not parse these as anchors, so we wouldn't have to escape them. Some possible criteria:

  • Don't recognize anchors #...# containing/starting with/ending with spaces
  • Don't recognize anchors #...# surrounded by {-, -}
  • Don't recognize anchors in the middle of code blocks

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