Feature request - test for illegal use of %%-references
I recently had quite some trouble debugging .md files that caused docker-compose up --force-recreate --build to produce errors while building the client (whatever that is). @miliadi pointed me in the direction for solving it (on Slack). While this fixed one problem, several others remained but knowing where/what to look for made the difference.
In order to prevent such situations to occur again (in fact, this has happened before but somehow was forgotten, which I do not want to be repeated again), I would like a new feature to be implemented in the CI-pipe that is capable of logging such errors and providing the information a developer needs to correct the markdown.
This could be done as follows:
- we have a configuration file (located in a directory that can be accessed by the user, e.g. in
docs) that contains a list of regexes that match illegal syntax. For starters, this list contains the following regexes:^hovertext:.*?%%and(alt|src)\s*=\s*"[^"]*?%% - at an appropriate place in the CI-pipe:
- scan all files that are going to be further processed (i.e. where <Term-constructs can be created), and for each file:
- log any match of that file with any of the regexes in the configured list, where the log states the regular expression that matches, the file in which the match occurred, and the line number and character position of the match.
- after all files have been scanned, throw an error if one or more matches occurred.