Calaca icon indicating copy to clipboard operation
Calaca copied to clipboard

HTML formatting for result.description

Open ccamacho opened this issue 8 years ago • 2 comments

Hey Roman,

Quick question, I'm trying to put some HTML in the result description, basically adding some < b r / > 's most specific here: https://github.com/romansanchez/Calaca/blob/master/_site/index.html#L33

Can you point me how to not escaping the description output as a string, instead getting it as HTML?

Cheers!

ccamacho avatar Jun 27 '16 21:06 ccamacho

Me too.. I have seen elsewhere that using {{{ }}} triple mustache works.. but hasn't changed anything with Calaca.

Will keep you updated.

danieljoshuajames avatar Jun 03 '17 16:06 danieljoshuajames

As a hacky fix, I'm just doing the following when the results have been returned:

                    $("p").each(function(i, current){
                        var str = $(current).text();
                        $(current).html(str);
                    });

It goes through each paragraph element and obtains its text value. Then it sets the html to the text value, so now any html is parsed. I know it ain't the best but it is a quick fix.

danieljoshuajames avatar Jun 03 '17 18:06 danieljoshuajames