Skip to content

Whitespace from Pygments spans is removed by html2htpy #143

@correctmost

Description

@correctmost

Description

I tried to use output from Pygments with html2htpy, but it seems like whitespace is removed from span elements:

$ echo '<pre><code><span class="k">FROM</span><span class="w"> </span><span class="s">fedora:42</span></code></pre>' | html2htpy

pre[code[span(".k")["FROM"], span(".w"), span(".s")["fedora:42"]]]

Expected behavior

I was hoping <span class="w"> </span> would be translated to span(".w")[" "] to retain the space. Right now, the output gets collapsed to "FROMfedora:42".

Version info

htpy 25.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions