[pollen] How to insert CDATA?

2017-11-19 Thread a . bezlepko


My plan_b.html.pm

#lang pollen
◊as-cdata{567}


My pollen.rkt

#lang racket/base
(require pollen/tag)
(require pollen/decode)
(require txexpr)
(require xml)
(require racket/list)
(provide (all-defined-out))

(define (as-cdata string)
  (cdata #f #f string))


My template.html


◊(->html ◊doc)



Result

...>raco pollen render plan_b.html.pm

rendering plan_b.html.pm
rendering: /plan_b.html.pm as /plan_b.html

->html: contract violation
  expected: (or/c txexpr-element? txexpr-elements?)
  given: '(root #(struct:cdata #f #f "567") "\n" "\n")
  in: the 1st argument of
  (->*
   ((or/c txexpr-element? txexpr-elements?))
   (#:attrs
(or/c #f txexpr-attrs?)
#:splice
boolean?
#:splice?
boolean?
#:tag
(or/c #f txexpr-tag?))
   string?)
  contract from:
  /pollen/pollen/template/html.rkt
  blaming: top-level
   (assuming the contract is correct)
  at: /pollen/pollen/template/html.rkt:14.26

-- 
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.


Re: [pollen] How to insert CDATA?

2017-11-19 Thread Matthew Butterick
Seems like it should work. Not sure why it isn't. I'll look into it.


> On Nov 19, 2017, at 1:10 PM, a.bezle...@gmail.com wrote:
> 
> 
> 
> My plan_b.html.pm
> 
> #lang pollen
> ◊as-cdata{567}
> 
> 
> My pollen.rkt
> 
> #lang racket/base
> (require pollen/tag)
> (require pollen/decode)
> (require txexpr)
> (require xml)
> (require racket/list)
> (provide (all-defined-out))
> 
> (define (as-cdata string)
>   (cdata #f #f string))
> 
> 
> My template.html
> 
> 
> ◊(->html ◊doc)
> 
> 

-- 
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.


Re: [pollen] How to insert CDATA?

2017-11-19 Thread Matthew Butterick
BTW the `->html` function, consistent with the HTML spec, will automatically 
treat `script` and `style` blocks as CDATA, so if that's what you're aiming 
for, no special sorcery needed.


> On Nov 19, 2017, at 3:36 PM, Matthew Butterick  wrote:
> 
> Seems like it should work. Not sure why it isn't. I'll look into it.
> 
> 
>> On Nov 19, 2017, at 1:10 PM, a.bezle...@gmail.com 
>>  wrote:
>> 
>> 
>> 
>> My plan_b.html.pm
>> 
>> #lang pollen
>> ◊as-cdata{567}
>> 
>> 
>> My pollen.rkt
>> 
>> #lang racket/base
>> (require pollen/tag)
>> (require pollen/decode)
>> (require txexpr)
>> (require xml)
>> (require racket/list)
>> (provide (all-defined-out))
>> 
>> (define (as-cdata string)
>>   (cdata #f #f string))
>> 
>> 
>> My template.html
>> 
>> 
>> ◊(->html ◊doc)
>> 
>> 
> 

-- 
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.


Re: [pollen] How to insert CDATA?

2017-11-19 Thread a . bezlepko
Hi,

I need to export in "confluence storage format" - 
https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html#ConfluenceStorageFormat-Links

понедельник, 20 ноября 2017 г., 7:15:58 UTC+3 пользователь Matthew 
Butterick написал:
>
> BTW the `->html` function, consistent with the HTML spec, will 
> automatically treat `script` and `style` blocks as CDATA, so if that's what 
> you're aiming for, no special sorcery needed.
>
>
> On Nov 19, 2017, at 3:36 PM, Matthew Butterick  > wrote:
>
> Seems like it should work. Not sure why it isn't. I'll look into it.
>
>
> On Nov 19, 2017, at 1:10 PM, a.bez...@gmail.com  wrote:
>
>
>
> My plan_b.html.pm
> 
> #lang pollen
> ◊as-cdata{567}
> 
>
> My pollen.rkt
> 
> #lang racket/base
> (require pollen/tag)
> (require pollen/decode)
> (require txexpr)
> (require xml)
> (require racket/list)
> (provide (all-defined-out))
>
> (define (as-cdata string)
>   (cdata #f #f string))
> 
>
> My template.html
> 
> 
> ◊(->html ◊doc)
> 
> 
>
>
>
>

-- 
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.