Difference between revisions of "Web-Markup-VimTips"
Jump to navigation
Jump to search
(Copy from PmWiki) |
(Initial conversion to MediaWiki markup.) |
||
Line 1: | Line 1: | ||
− | + | = Editing FAQ = | |
− | + | ||
− | * This colon command changes unquoted numeric attribute values to quoted values | + | <blockquote> |
− | + | ||
− | + | == How do I change unquoted attribute values to quoted values? == | |
+ | |||
+ | * This colon command changes unquoted numeric attribute values to quoted values | ||
+ | *:<div style="background-color: #EEEEEE; border: dashed; border-width: 1px; font-family: courier; margin: 1en 1en; padding: 1ex; white-space: pre;"><nowiki>g/./s/=\([0-9]*\)\([ >]\)/="\1"\2/g</nowiki></div> | ||
+ | |||
+ | == How do I switch HTML or XHTML tag and attribute names to lowercase? == | ||
+ | |||
* Use the following colon commands in a vim editor after making sure that all attribute values are quoted. Attributes without quotes are not modified. | * Use the following colon commands in a vim editor after making sure that all attribute values are quoted. Attributes without quotes are not modified. | ||
− | ** Entities | + | ** Entities |
− | + | **:<div style="background-color: #EEEEEE; border: dashed; border-width: 1px; font-family: courier; margin: 1en 1en; padding: 1ex; white-space: pre;"><nowiki>%s/<\/\?\zs\(\w\+\)\ze[ >]/\L\1/g</nowiki></div> | |
− | ** Attributes | + | ** Attributes |
− | + | **:<div style="background-color: #EEEEEE; border: dashed; border-width: 1px; font-family: courier; margin: 1en 1en; padding: 1ex; white-space: pre;"><nowiki>%s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/g</nowiki></div> | |
− | + | ||
− | * | + | == Where can I find lists of character entities? == |
+ | |||
+ | * [http://www.elizabethcastro.com/html/extras/entities.html HTML/XHTML Entities] | ||
+ | |||
+ | </blockquote> | ||
+ | |||
+ | [[Category:Web]] | ||
+ | [[Category:Web-Markup]] |
Latest revision as of 05:40, 3 January 2018
Contents
Editing FAQ
How do I change unquoted attribute values to quoted values?
- This colon command changes unquoted numeric attribute values to quoted values
g/./s/=\([0-9]*\)\([ >]\)/="\1"\2/gHow do I switch HTML or XHTML tag and attribute names to lowercase?
- Use the following colon commands in a vim editor after making sure that all attribute values are quoted. Attributes without quotes are not modified.
- Entities
%s/<\/\?\zs\(\w\+\)\ze[ >]/\L\1/g- Attributes
%s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/gWhere can I find lists of character entities?