Re: [pollen] Excessive spaces in pre

2016-12-29 Thread Matthew Butterick
One can also produce the same behavior in `#lang scribble/text`:

#lang scribble/text
@(require pollen/template/html)
@(define (test)
(->html `(pre " 1\n 2\n 3\n 4")))
@(define (iden . s) s)
  @iden{@(test)}

Given that this is not a Pollen problem per se, you might get a more satisfying 
answer by posting on issue on the `racket/scribble` repo (I do, sometimes) and 
see what they say. If the scribble authors agree it's a bug, and repair it, 
then the fix will flow into Pollen too.


> On Dec 29, 2016, at 10:54 AM, sorawee_porncharoenw...@brown.edu wrote:
> 
> Kind of. Here's an example:
> 
>   @(define (test)
> (->html `(pre " 1\n 2\n 3\n 4")))
>   @(define (iden . s) s)
>   @iden{@(test)}
> 
> which results in
> 
> 1
>   2
>   3
>   4
> 
> while 
> 
>   @(define (test)
> (->html `(pre " 1\n 2\n 3\n 4")))
>   @(define (iden . s) s)
> @iden{@(test)}
> 
> results in:
> 
> 1
> 2
> 3
> 4
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[pollen] Excessive spaces in pre

2016-12-25 Thread sorawee_porncharoenwase
  ◊(define test `(pre " 1\n 2\n 3\n 4"))
  ◊(->html test)
  ◊when/splice[#t]{◊(->html test)}

in the template file results in:

1
2
3
4

1
  2
  3
  4

while:

◊(define test `(pre " 1\n 2\n 3\n 4"))
◊(->html test)
◊when/splice[#t]{◊(->html test)}

results in:

1
2
3
4

1
2
3
4

This causes wrong code display in some sites. For example, 
see http://mstill.io/blog/pollen-count.html

I think I know why this happens: @-reader is trying to be smart, but it 
causes this unexpected behavior. Is this a known issue? I think it would be 
really great to have this documented somewhere so that people won't have to 
scratch their head.

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.