No description
Find a file
Edward Betts 4fe0acc167 Improve link matching to avoid many classes of bad edits
parse_cite: extend to skip {{cite}}/{{citation}}, {{short description}},
{{gli}}, {{defn}}, external links [https://...], italic text ''...'',
and bullet-point lines containing bare URLs (unformatted bibliography
entries). Uses brace-counting to handle nested templates correctly.

parse_links: yield [[Category:...]] links as 'category' tokens so they
are never modified.

add_link: handle three new boundary cases where the match spans an
existing [[link]]:
- match ends exactly at the link boundary: replace the whole thing with
  a single clean link (e.g. surface [[runoff (hydrology)|runoff]] →
  [[surface runoff]])
- match starts right after [[: absorb the stray [[ (e.g.
  [[anti-globalization]] movement → [[anti-globalization movement]])
- match starts partway inside a link: skip (would produce broken wikitext)
- match spans into but not through a link: use a piped prefix link
  (e.g. cross-platform [[interchange station]] →
  [[cross-platform interchange|cross-platform]] [[interchange station]])

Fallback search: mask [[Category:...]] spans with spaces so the pattern
cannot match inside them. Guard against matches that are part of a
longer named entity (title-case phrase followed by extra words then an
abbreviation in parentheses, e.g. "Anti-Globalization Movement of
Russia (AGMR)").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:11:23 +01:00
add_links Improve link matching to avoid many classes of bad edits 2026-05-09 18:11:23 +01:00
frontend Initial commit 2023-10-04 12:56:21 +01:00
static/css Move CSS out of template to static file 2023-11-25 19:56:25 +00:00
templates Rename article2.html to article.html 2023-11-26 14:13:51 +00:00
.gitignore Add static/bootstrap to .gitignore 2023-11-26 14:10:00 +00:00
add_front_end_libraries.py Initial commit 2023-10-04 12:56:21 +01:00
cmdline.py Tidy code for building list of examples 2023-12-09 18:43:56 +00:00
package.json Initial commit 2023-10-04 12:56:21 +01:00
vite.config.js Initial commit 2023-10-04 12:56:21 +01:00
web_view.py Fix OAuth User-Agent header and improve error handling 2026-05-09 18:11:23 +01:00