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

Fix issue #505: DIET: doctype is actually ignored #509

Merged
merged 1 commit into from
Feb 9, 2014

Conversation

nazriel
Copy link
Contributor

@nazriel nazriel commented Feb 9, 2014

Fix issue #505

Again, not sure if it is the best approach.

Btw, I didn't know if I should use:

case "!!!":
    ln = ln[j + 3 .. $]; 
    goto case "doctype";
case "doctype"
...

Or the one I used in code.

Also I am not sure if code guidelines are correct.
Btw what is maximum column line, 120?

Edit: Should I add unittest with those cases?

@nazriel
Copy link
Contributor Author

nazriel commented Feb 9, 2014

Travis failure seems to be unrelated.
Unittests passed on my computer.

Btw, if it gets merged I will try to fix issue #475

@s-ludwig
Copy link
Member

s-ludwig commented Feb 9, 2014

Btw, I didn't know if I should use:

case "!!!":
    ln = ln[j + 3 .. $]; 
    goto case "doctype";
case "doctype"
...

Or the one I used in code.

I'd even go a line up and change

if( ln.startsWith("!!! ") ) tag = "!!!";

to

if (ln.startsWith("!!! ")) {
    // later: output.writeCode(`pragma(msg, "\"!!!\" is deprecated, use \"doctype\" instead.");`)
    tag = "doctype";
    j += 4;
}

Code style wise it looks good, except for maybe the indented ~ "... parts, which I would only indent with a single tab, but that's really not critical. Even though there is no strict line Iength limit (120 is kind of a soft limit and 80 for doc comments), I would move the "doctype" case contents to a separate buildDoctypeNodeWriter function in this case, because the nesting gets a little deep.

BTW: I've found the rationale for the deprecation of !!!: pugjs/pug#1270
I'm not sure if I can really agree with that, but it will be good to stay compatible if thats the definite way they go.

@nazriel
Copy link
Contributor Author

nazriel commented Feb 9, 2014

@s-ludwig updated!
I left it to you to decide when we deprecate !!!

@s-ludwig
Copy link
Member

s-ludwig commented Feb 9, 2014

Perfect, thanks!

s-ludwig added a commit that referenced this pull request Feb 9, 2014
Fix issue #505: DIET: doctype is actually ignored
@s-ludwig s-ludwig merged commit 7dbaeb8 into vibe-d:master Feb 9, 2014
@nazriel
Copy link
Contributor Author

nazriel commented Feb 9, 2014

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants