duckduckgo / zeroclickinfo-goodies

DuckDuckGo Instant Answers based on Perl & JavaScript
https://duckduckhack.com/
Other
979 stars 1.76k forks source link

Add support for newline in cheatsheet #1920

Closed gautamkrishnar closed 8 years ago

gautamkrishnar commented 8 years ago

\n Must be parsed as a newline in cheatsheet key values

gautamkrishnar commented 8 years ago

1915 @moollaza

mintsoft commented 8 years ago

IIRC It is parsed as such, it's just that browsers ignore insignificant whitespace; I'm guessing that the desired behaviour is to actually output <br/> or something similar when the cheatsheet engine encounters a newline?

gautamkrishnar commented 8 years ago

@mintsoft Ya the \n must be parsed as a <br/> It will makes the writing of programming cheatsheets easier... for example we can use:

key:"var x;\n x=2;"
val:"Declare and initialize"

For real \n we can use double escape sequence: \\n

moollaza commented 8 years ago

I already have a PR in progress for this. I need to carefully review what IA's it will affect though which is why I haven't merged it yet.

See #1167

gautamkrishnar commented 8 years ago

Yes. As it is a work in progress, i will close this right now

GuiltyDolphin commented 8 years ago

I'll re-open this until it is fixed - it is still a valid issue AFAIK.

moollaza commented 8 years ago

Fixed in #2627

moollaza commented 8 years ago

@gautamkrishnar take a look at this now in DuckPAN -- newlines are working :+1:

gautamkrishnar commented 8 years ago

Hey cool :candy: