Commit c034071526f191e2e21564b4d77971c68fc9192e

Diagnose references with wrong case
This might work and be left unnoticed in Vim because 'ignorecase'
applies to resolution of tags.
Author: xaizek
Author date (UTC): 2023-07-01 15:14
Committer name: xaizek
Committer date (UTC): 2023-07-01 15:14
Parent(s): 0c76fb48abeac9cbde28ec4243d16497e7733c6f
Signing key: 99DC5E4DB05F6BE2
Tree: e1f59a7deea4c4fc1267d580dee6480e3772ee3f
File Lines added Lines deleted
vimd2h.py 10 1
File vimd2h.py changed (mode: 100755) (index fe7dc7e..f6970ce)
... ... class Link(object):
71 71 class VimDoc2HTML(object): class VimDoc2HTML(object):
72 72 def __init__(self, tags, version=None): def __init__(self, tags, version=None):
73 73 self._urls = { } self._urls = { }
74 self._urlsCI = { }
74 75 self._version = version self._version = version
75 76 for line in RE_NEWLINE.split(tags): for line in RE_NEWLINE.split(tags):
76 77 m = RE_TAGLINE.match(line) m = RE_TAGLINE.match(line)
 
... ... class VimDoc2HTML(object):
92 93 elif special is not None: classattr = ' class="s"' elif special is not None: classattr = ' class="s"'
93 94 link_plain = part1 + classattr + part2 link_plain = part1 + classattr + part2
94 95 self._urls[tag] = Link(link_pipe, link_plain) self._urls[tag] = Link(link_pipe, link_plain)
96 self._urlsCI[tag.lower()] = True
95 97
96 98 def maplink(self, tag, css_class=None): def maplink(self, tag, css_class=None):
97 99 links = self._urls.get(tag) links = self._urls.get(tag)
 
... ... class VimDoc2HTML(object):
100 102 else: return links.link_plain else: return links.link_plain
101 103 elif css_class is not None: elif css_class is not None:
102 104 if css_class == 'l': if css_class == 'l':
103 print('Unresolved reference: |%s|' % tag)
105 lowerTag = tag.lower()
106 if lowerTag in self._urlsCI:
107 print('Unresolved reference: |%s|' % tag)
108 for key in self._urls:
109 if key.lower() == lowerTag:
110 print(' - tag with different case: |%s|' % key)
111 else:
112 print('Unresolved reference: |%s|' % tag)
104 113
105 114 return '<span class="' + css_class + '">' + html_escape[tag] + \ return '<span class="' + css_class + '">' + html_escape[tag] + \
106 115 '</span>' '</span>'
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vimdoc2html

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vimdoc2html

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master