Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-debug option seems to only remove first line of debug info #2389

Closed
derickvn opened this issue May 17, 2016 · 1 comment
Closed

--no-debug option seems to only remove first line of debug info #2389

derickvn opened this issue May 17, 2016 · 1 comment

Comments

@derickvn
Copy link

Here is an example of a simple template with and without debug:
Template:

html
    head
        title Skeleton template
        meta(charset="UTF-8")
        meta(name="viewport" content="width=device-width, initial-scale=1.0")
        link(rel="stylesheet" type="text/css" href="/css/styles.css")
    body
        #content.container-fluid Loading Application...
        script(src="/lib/jquery/jquery-2.2.3.min.js")
        script(src="/lib/bootstrap/js/bootstrap.min.js")
        script(src="/js/scripts.js")

without --no-debug:


function pug_rethrow(n,e,r,t){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&e||t))throw n.message+=" on line "+r,n;try{t=t||require("fs").readFileSync(e,"utf8")}catch(i){pug_rethrow(n,null,r)}var a=3,o=t.split("\n"),h=Math.max(r-a,0),s=Math.min(o.length,r+a),a=o.slice(h,s).map(function(n,e){var t=e+h+1;return(t==r?"  > ":"    ")+t+"| "+n}).join("\n");throw n.path=e,n.message=(e||"Pug")+":"+r+"\n"+a+"\n\n"+n.message,n}function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_debug_filename, pug_debug_line;try {var pug_debug_sources = {"src\u002Ftemplates\u002F\u002Findex.pug":"html\n\thead\n\t\ttitle Skeleton template\n\t\tmeta(charset=\"UTF-8\")\n\t\tmeta(name=\"viewport\" content=\"width=device-width, initial-scale=1.0\")\n\t\tlink(rel=\"stylesheet\" type=\"text\u002Fcss\" href=\"\u002Fcss\u002Fstyles.css\")\n\tbody\n\t\t#content.container-fluid Loading Application...\n\t\tscript(src=\"\u002Flib\u002Fjquery\u002Fjquery-2.2.3.min.js\")\n\t\tscript(src=\"\u002Flib\u002Fbootstrap\u002Fjs\u002Fbootstrap.min.js\")\n\t\tscript(src=\"\u002Fjs\u002Fscripts.js\")\n"};
;pug_debug_line = 1;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Chtml\u003E";
;pug_debug_line = 2;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Chead\u003E";
;pug_debug_line = 3;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Ctitle\u003E";
;pug_debug_line = 3;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "Skeleton template\u003C\u002Ftitle\u003E";
;pug_debug_line = 4;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cmeta charset=\"UTF-8\"\u002F\u003E";
;pug_debug_line = 5;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u002F\u003E";
;pug_debug_line = 6;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Clink rel=\"stylesheet\" type=\"text\u002Fcss\" href=\"\u002Fcss\u002Fstyles.css\"\u002F\u003E\u003C\u002Fhead\u003E";
;pug_debug_line = 7;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cbody\u003E";
;pug_debug_line = 8;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cdiv class=\"container-fluid\" id=\"content\"\u003E";
;pug_debug_line = 8;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "Loading Application...\u003C\u002Fdiv\u003E";
;pug_debug_line = 9;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Flib\u002Fjquery\u002Fjquery-2.2.3.min.js\"\u003E\u003C\u002Fscript\u003E";
;pug_debug_line = 10;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Flib\u002Fbootstrap\u002Fjs\u002Fbootstrap.min.js\"\u003E\u003C\u002Fscript\u003E";
;pug_debug_line = 11;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Fjs\u002Fscripts.js\"\u003E\u003C\u002Fscript\u003E\u003C\u002Fbody\u003E\u003C\u002Fhtml\u003E";} catch (err) {pug_rethrow(err, pug_debug_filename, pug_debug_line, pug_debug_sources[pug_debug_filename]);};return pug_html;}

with --no-debug

function pug_rethrow(n,e,r,t){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&e||t))throw n.message+=" on line "+r,n;try{t=t||require("fs").readFileSync(e,"utf8")}catch(i){pug_rethrow(n,null,r)}var a=3,o=t.split("\n"),h=Math.max(r-a,0),s=Math.min(o.length,r+a),a=o.slice(h,s).map(function(n,e){var t=e+h+1;return(t==r?"  > ":"    ")+t+"| "+n}).join("\n");throw n.path=e,n.message=(e||"Pug")+":"+r+"\n"+a+"\n\n"+n.message,n}function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_debug_filename, pug_debug_line;try {;pug_debug_line = 1;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Chtml\u003E";
;pug_debug_line = 2;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Chead\u003E";
;pug_debug_line = 3;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Ctitle\u003E";
;pug_debug_line = 3;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "Skeleton template\u003C\u002Ftitle\u003E";
;pug_debug_line = 4;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cmeta charset=\"UTF-8\"\u002F\u003E";
;pug_debug_line = 5;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u002F\u003E";
;pug_debug_line = 6;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Clink rel=\"stylesheet\" type=\"text\u002Fcss\" href=\"\u002Fcss\u002Fstyles.css\"\u002F\u003E\u003C\u002Fhead\u003E";
;pug_debug_line = 7;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cbody\u003E";
;pug_debug_line = 8;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cdiv class=\"container-fluid\" id=\"content\"\u003E";
;pug_debug_line = 8;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "Loading Application...\u003C\u002Fdiv\u003E";
;pug_debug_line = 9;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Flib\u002Fjquery\u002Fjquery-2.2.3.min.js\"\u003E\u003C\u002Fscript\u003E";
;pug_debug_line = 10;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Flib\u002Fbootstrap\u002Fjs\u002Fbootstrap.min.js\"\u003E\u003C\u002Fscript\u003E";
;pug_debug_line = 11;pug_debug_filename = "src\u002Ftemplates\u002F\u002Findex.pug";
pug_html = pug_html + "\u003Cscript src=\"\u002Fjs\u002Fscripts.js\"\u003E\u003C\u002Fscript\u003E\u003C\u002Fbody\u003E\u003C\u002Fhtml\u003E";} catch (err) {pug_rethrow(err, pug_debug_filename, pug_debug_line);};return pug_html;}
@TimothyGu
Copy link
Member

Duplicate of pugjs/pug-cli#23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants