Skip to content

pygments fails to guess scdoc lexer for scdoc files #2399

@stacyharper

Description

@stacyharper

Hey there,

I'm investigating why scdoc files are rendered that badly on srht, and it looks like this is because pygments fails to guess the lexer correctly.

Example of rendered pages:

https://git.sr.ht/~stacyharper/sxmobar/tree/main/item/docs/sxmobar.1.scd
https://git.sr.ht/~sircmpwn/himitsu/tree/master/item/docs/hiq.1.scd

Trying pygments locally:

$ scripts/debug_lexer.py -g sxmobar.1.scd
Using lexer: Transact-SQL (pygments.lexers.sql.TransactSqlLexer)
Error parsing sxmobar.1.scd on line 3
Previous tokens:
   'sxmobar'                     Token.Name 
   '('                           Token.Punctuation 
   '1'                           Token.Literal.Number.Integer 
   ')'                           Token.Punctuation 
   '\n\n'                        Token.Text.Whitespace 
Error token:
   '#' 

How can I help?

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