pug - In a Jade template how do I put a literal URL as a link anchor? -


in node.js express web app, include link documentation in 1 of views, , show url anchor text. following jade: links inside paragraph, tried:

p see #[a(href="http://example.com/help/123") http://example.com/help/123] 

however, causes error, "the end of string reached no closing bracket found."

if put quotes around anchor text, works, end quotes visible in html output, don't want.

p see #[a(href="http://example.com/help/123") "http://example.com/help/123"] 

is unquoted url messing evaluation of stuff inside brackets? if so, can escape somehow prevent problem?

use variable:

-var helpurl="http://example.com/help/123" p see #[a(href=helpurl) #{helpurl}] 

the double slash in url being interpreted start of comment, , preventing evaluator reading rest of expression, including closing bracket.

edit: issue kindly opened @laggingreflex (https://github.com/jadejs/jade/issues/2144), colon-slash sequence problematic prior jade 2.0.0. using earlier versions, jade author forbeslindesay recommends using equals-sign evaluation of literal string.

p see #[a(href="http://example.com/help/123")= "http://example.com/help/123"] 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -