Skip to content

Bug fix: Ensure spacing between text nodes

Compare
Choose a tag to compare
@tdumitrescu tdumitrescu released this 01 Mar 19:52
· 36 commits to master since this release

Previously, contiguous piped text blocks were rendered without breaks; for instance:

p
  | Hello
  | world

would result in HTML output of <p>Helloworld</p>, which diverges from the behavior specified at https://pugjs.org/language/plain-text.html. With this fix the above renders as <p>Hello world</p>. NB when mixing piped text with other tags, spaces are deliberately not added between tag texts, as in the example from the linked documentation:

| You put the em
em pha
| sis on the wrong syl
em la
| ble.

This still renders as You put the em<em>pha</em>sis on the wrong syl<em>la</em>ble..