#10 support syntax folds

Open
konfekt wants to merge 5 commits from konfekt/patch-1 into jorgesumle/master
Enno commented 5 years ago

The option g:html_syntax_folding must also be documented at :help ft-html.

The option `g:html_syntax_folding` must also be documented at `:help ft-html`.
Enno commented 5 years ago
Poster

This addresses #9

This addresses https://notabug.org/jorgesumle/vim-html-syntax/issues/9

Just write syn instead of syntax. Also why do you want to add support to Netscape comments, as far as I know, they aren't used anymore? You should also modify the comments at the top of the file, as the README says. I don't like the comment pointing to an Internet URL, it's not even necessary to comment that because you can learn what everything does using built-in Vim help. And I would write " Syntax folds instead of " Support Syntax Folds to keep it simpler.

Just write `syn` instead of syntax. Also why do you want to add support to Netscape comments, as far as I know, they aren't used anymore? You should also modify the comments at the top of the file, as the [README](https://notabug.org/jorgesumle/vim-html-syntax#contributing) says. I don't like the comment pointing to an Internet URL, it's not even necessary to comment that because you can learn what everything does using built-in Vim help. And I would write `" Syntax folds` instead of `" Support Syntax Folds` to keep it simpler.
Enno commented 5 years ago
Poster

Fixed everything; except: Regarding the removal of Netscape comments, this is out of the scope of this pull request. (Note that they are defined earlier and only overwritten in case g:html_syntax_folding exists.)

Fixed everything; except: Regarding the removal of Netscape comments, this is out of the scope of this pull request. (Note that they are defined earlier and only overwritten in case `g:html_syntax_folding` exists.)

Regarding the removal of Netscape comments, this is out of the scope of this pull request.

I'm not telling you to remove old code, I'm just against including new code for something non-standard that people aren't writting today (except a very, very small minority, maybe nonexistent, who are still dealing with very old HTML code and would also want to fold that old comments with Vim). Anyways, instead of folding that old non-standard comments, they should rewrite them to proper HTML.

> Regarding the removal of Netscape comments, this is out of the scope of this pull request. I'm not telling you to remove old code, I'm just against including new code for something non-standard that people aren't writting today (except a very, very small minority, maybe nonexistent, who are still dealing with very old HTML code and would also want to fold that old comments with Vim). Anyways, instead of folding that old non-standard comments, they should rewrite them to proper HTML.
Enno commented 5 years ago
Poster

Okay, removed. Then again, it might be time to review the Comment highlighting, as all comments other than those old non-standard ones are only highlighted if the variable g:html_wrong_comments exists; by the way, where is its existence ensured?

Okay, removed. Then again, it might be time to review the Comment highlighting, as all comments other than those old non-standard ones are only highlighted if the variable `g:html_wrong_comments` exists; by the way, where is its existence ensured?
Enno commented 5 years ago
Poster

The documentation to this syntax file at :ft-html-syntax explicitely states

HTML comments are rather special (see an HTML reference document for the details), and the syntax coloring scheme will highlight all errors. However, if you prefer to use the wrong style (starts with <!-- and ends with -->) you can define >

:let html_wrong_comments=1

This place :help ft-html-syntax is also where g:html_syntax_folding must be documented.

The documentation to this syntax file at `:ft-html-syntax` explicitely states > HTML comments are rather special (see an HTML reference document for the details), and the syntax coloring scheme will highlight all errors. However, if you prefer to use the wrong style (starts with `<!--` and ends with `-->`) you can define > :let html_wrong_comments=1 This place `:help ft-html-syntax` is also where `g:html_syntax_folding` must be documented.

Then :ft-html-syntax is wrong. The HTML 5 Recommendation says:

Comments must have the following format:

  1. The string "<!--"
  2. Optionally, text, with the additional restriction that the text must not start with the string ">", nor start with the string "->", nor contain the strings "", or "--!>", nor end with the string "<!-".
  3. The string "-->"

Still, it would be advisable in my opinion to learn when was that written and why. Maybe the standard was different then.

PD. Sorry, I don't have much time right now to work on this. After all the feedback, I see that you can submit a good patch and even remember about changing the documentation, would you like to become the new maintainer of the HTML syntax file so that you can get this merged? I guess you can ask in the Vim mailing list, and link to this comment of mine.

Then `:ft-html-syntax` is wrong. The [HTML 5 Recommendation says](https://www.w3.org/TR/html5/syntax.html#comments): > Comments must have the following format: > 1. The string "<!--" > 2. Optionally, text, with the additional restriction that the text must not start with the string ">", nor start with the string "->", nor contain the strings "<!--", "-->", or "--!>", nor end with the string "<!-". > 3. The string "-->" Still, it would be advisable in my opinion to learn when was that written and why. Maybe the standard was different then. PD. Sorry, I don't have much time right now to work on this. After all the feedback, I see that you can submit a good patch and even remember about changing the documentation, would you like to become the new maintainer of the HTML syntax file so that you can get this merged? I guess you can ask in the Vim mailing list, and link to this comment of mine.
Enno commented 5 years ago
Poster

Olá!

This documentation and the code of the syntax/html.vim file must be old.

One should invert things nowadays, that is, default to the code for the case html_wrong_comments=1, and add a check for a variablehtml_old_comments, non-existent by default, that uses the code that is currently default; again this should be documented at :help ft-html-syntax.

Therefore, the file doc/syntax.txt should also be part of the repo to document all changes.

I do not work with HTML, I am not a web developer (I just find folding convenient and added the code by Ingo Karkat and Marcus Zanona), but if you deem that I could better take of this syntax file, then I will do so. I would think about a text inviting web developers taking over maintenance, but offering mine instead.

Olá! This documentation and the code of the syntax/html.vim file must be old. One should invert things nowadays, that is, default to the code for the case `html_wrong_comments=1`, and add a check for a variable`html_old_comments`, non-existent by default, that uses the code that is currently default; again this should be documented at `:help ft-html-syntax`. Therefore, the file `doc/syntax.txt` should also be part of the repo to document all changes. I do not work with `HTML`, I am not a web developer (I just find folding convenient and added the code by Ingo Karkat and Marcus Zanona), but if you deem that I could better take of this syntax file, then I will do so. I would think about a text inviting web developers taking over maintenance, but offering mine instead.
Enno commented 4 years ago
Poster

Dear Jorge,

Is there still interest in this pull request? Other than folding, maybe html_wrong_comments=1 can be made a default as well?

Best wishes,

 Enno
Dear Jorge, Is there still interest in this pull request? Other than folding, maybe `html_wrong_comments=1` can be made a default as well? Best wishes, Enno

You can make the necessary work and send it as a pull request. You aleady know what it needs to be done, so feel free to finish this work and send it to Vim. It's not only the syntax file what you need to change, but also a bit of the documentation

Change the maintainer line and link them to https://github.com/vim/vim/pull/5396#issuecomment-568757271 if they say you're not the maintainer. I can give you write access to this repository if you want.

You can make the necessary work and send it as a pull request. You aleady know what it needs to be done, so feel free to finish this work and send it to Vim. It's not only the syntax file what you need to change, but also a bit of the documentation Change the maintainer line and link them to https://github.com/vim/vim/pull/5396#issuecomment-568757271 if they say you're not the maintainer. I can give you write access to this repository if you want.

You can make the necessary work and send it as a pull request. You aleady know what it needs to be done, so feel free to finish this work and send it to Vim. It's not only the syntax file what you need to change, but also a bit of the documentation

Change the maintainer line and link them to https://github.com/vim/vim/pull/5396#issuecomment-568757271 if they say you're not the maintainer. I can give you write access to this repository if you want.

You can make the necessary work and send it as a pull request. You aleady know what it needs to be done, so feel free to finish this work and send it to Vim. It's not only the syntax file what you need to change, but also a bit of the documentation Change the maintainer line and link them to https://github.com/vim/vim/pull/5396#issuecomment-568757271 if they say you're not the maintainer. I can give you write access to this repository if you want.
This pull request can't be merged automatically because there are conflicts.
Please merge manually in order to resolve the conflicts.
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.