Skip to content

--width may cause a wrap between a backtick and the neighboring printable character #819

@rolfschr

Description

@rolfschr

Describe the bug

With --width N, the text gets word wrapped.

Content in backticks is rendered with a different background color and a space around the content instead of show the backtick.

A combination of both may lead to the space in front of the backticked-content to stay on one line and the content itself to be placed on the next line. I would expect the space to be non-breakable ("non-breaking space") but it isn't. See example below.

Setup
Please complete the following information along with version numbers, if applicable.

  • NixOS
  • bash
  • konsole
  • tmux
  • en_US.UTF-8
  • glow v2.1.0

To Reproduce
Steps to reproduce the behavior:

echo "\`test\` \`test\` \`test\` \`test\` \`test\`" > file.md
glow --width 30 file.md

Source Code
Please include source code if needed to reproduce the behavior.

Expected behavior

The last "black cell" on the first line be shown in the next line only or the whole file should be rendered on a single line (i.e. no wrap here).

Screenshots

Image

Additional context

Not sure these are related:
#668
#666

Thank you for this great tool.

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