Closed LiberalArtist closed 2 years ago
I'm a bit confused. I think you want the evaluation result to be something that has newline characters, not printing a newline character (which is what newline
does), no?
#lang scribble/base
abc @(newline) 123
@(displayln "qwerty")
I don't expect to see any qwerty
in the generated file either (but I do get the newline and qwerty
in the stdout).
According to the doc of decode-flow
:
A sequence of two or more newlines separated only by whitespace is parsed as a compound-paragraph separator.
So:
#lang scribble/base
abc
def
is rendered as:
abc def
while:
#lang scribble/base
abc
def
is rendered as:
abc
def
So if you want a new paragraph, perhaps use '("\n" "\n")
or something like that?
#lang scribble/base
abc@|'("\n" "\n")|def
for me correctly outputs:
abc
def
Ah, sorry, I wrote this confusingly. I meant (linebreak)
from scribble/base
, which produces an element with the style name 'newline
. I'll edit the post above. The implementation in https://github.com/racket/scribble/pull/334 works (with caveats as noted); I'll fix the commit message now.
Ah, yes, I think it is indeed broken.
@history
from scribble/manual
is at least one place that uses linebreak
, and it is rendered incorrectly in the text mode too.
Scribble doesn't handle
(linebreak)
properly when generating plain text output. For example:It looks like something needs to happen in
render-paragraph
, but I'm not immediately sure how to communicate which newlines to keep—maybe specials?Related to https://github.com/racket/racket/pull/4301
Edit: Fixed the example.