Open slichlyter12 opened 7 years ago
I don't think it should skip comments. I think styling them differently would be best. The way I see myself using Postal would be for mostly non-HTML projects and I would use the comments as the way of making links. That would be just the simplest for me personally and I think other people would try to use it the same way.
I understand why we would want to skip them though.
I think we should add in a comments section to the grammars file. The parser behavior will be extremely similar to the "tagged" type. There is also no need for "tagEnd".
Here is an example JSON:
"rules": [{
"title": "comments",
"type": "comment",
"options": {
"openTag": "<!--",
"closeTag": "-->",
"nodeColor": "grey"
}
}]
We could also have another option which would allow the user to define ignorable comments versus styled comments. Ignored comments would be such things like descriptions of code whereas styled comments could be code that the user commented out but may want to see how it might connect in the future.
The parser should ignore links (or maybe style them differently) that are commented out in the users code. For example if the user has a list of links but one is commented out, the parser still counts this whereas it should probably be handled differently.
The following example is from kingfish:header.php
Links to "About" and "Neighborhood" should be ignored, but they aren't.