Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xexpr->string screws up whitespace #75

Open
sorawee opened this issue Nov 8, 2018 · 1 comment · May be fixed by #76
Open

xexpr->string screws up whitespace #75

sorawee opened this issue Nov 8, 2018 · 1 comment · May be fixed by #76

Comments

@sorawee
Copy link

sorawee commented Nov 8, 2018

Consider:

#lang racket

(require (only-in markdown [xexpr->string f1]))
(require (only-in xml [xexpr->string f2]))

(define (xexprs->string f xs)
  (string-join (map f xs) "\n"))

(define data '((p () "Hello" (label) ".")))

(xexprs->string f1 data)
(xexprs->string f2 data)

Here's the result:

"\n<p>Hello\n <label></label>.</p>"
"<p>Hello<label></label>.</p>"

When rendered, xexpr->string from this package will produce an extraneous whitespace which is incorrect. Since Frog uses this function, HTML rendering in Frog is also wrong.

@sorawee
Copy link
Author

sorawee commented Nov 8, 2018

The behavior seems to be intentional (

(when (and (zero? pre)
), but it's wrong. If I write

a<label></label>b

a and b should not be separated by a whitespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant