robot icon indicating copy to clipboard operation
robot copied to clipboard

invalid xref check is too strict

Open balhoff opened this issue 2 years ago • 2 comments

The invalid xref check uses this regex: "^[a-z|A-Z|_|\\-|0-9]*:(?!$)\\S*$"

It should allow . in the prefix part: https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName

balhoff avatar Jun 29 '23 16:06 balhoff

tbh the checks is also missing some cases.

  • ^[a-z|A-Z|_|\\-|0-9]*:(?!$)\\S*$ (OLD)
  • ^[a-z|A-Z][a-z|A-Z|_|\\-|0-9|\\.]*[a-z|A-Z|0-9]:(?!$)\\S*$ (Proposed new)

So basically:

  1. first character of prefix must be an upper or lower case alphabetical character.
  2. last character of prefix must be an upper or lower case alphabetical character or number.
  3. prefix may contain period anywhere in between first and last character

What do you think @balhoff?

matentzn avatar Jun 29 '23 17:06 matentzn

Seems good to me.

balhoff avatar Jan 22 '24 20:01 balhoff