[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] using cow



On 23 Dec 2013, at 21:38, Anil Madhavapeddy wrote:

> On 23 Dec 2013, at 21:36, Richard Mortier <Richard.Mortier@xxxxxxxxxxxxxxxx> 
> wrote:
>> 
>> hm-- i'm not sure an html parser will actually help. some of the inline 
>> markdown content is invalid html (i believe).
>> 
>> eg., rendering the blockquotes from your slides is another piece of inline 
>> markdown that has to be done manually:
>> 
>>> this is a blockquote rendered as
>>> a <blockquote><p>...</p></blockquote>
>> 
>> needs to have the <blockquote>...etc put in manually. surrounding with CDATA 
>> allows cow to escape the to &gt;  
>> 
>> similarly some of the indentation in code blocks isn't passed through by 
>> CDATA correctly.
>> 
>> i've managed to make most of them except your lectures look ok. i'll push 
>> changes -- if you can figure out a solution, let me know. else i'll have to 
>> go back to serving fragments from files i think.
> 
> Does the CDATA solution work for the Markdown, or does it get in the way?  It 
> should be pretty much the same, in theory.

it works for some of the markdown, but there are some things it doesn't help. 
basically, it stops cow barfing if there are characters like & < > when it 
parses the input; but cow then escapes these which means the js in the page 
that parses the markdown can't recognise them.

eg., `<&>` in a markdown fragment either causes cow to barf (parse error), or 
if surrounded by CDATA cow turns it into `&lt;&amp;&gt;` in the html returned 
to the browser, so the js then renders it as the corresponding string literal 
(in html, "&amp;lt;&amp;amp;&amp;gt;") in a monospaced font. 

the best i can think of is some way to explicitly tell cow to not parse a chunk 
of input and leave it "raw". or else i'll have to revert to serving fragments 
out of files and not use cow at all.


-- 
Cheers,

R.




This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, copy 
or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system, you 
are advised to perform your own checks. Email communications with the 
University of Nottingham may be monitored as permitted by UK legislation.





_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.