Fix compile-time link validation and add tag page links

- Restore HTML link extraction in LinkValidator (removed in a83634d
  under the false premise that post bodies are raw markdown; they
  are HTML rendered by NimblePublisher at compile time). The missing
  regex made extract_links/1 find zero links, silently disabling
  compile-time validation.
- Support /blog/{blog_id}/tag/{tag} links: validate blog ID,
  require non-empty tag (tags are user-defined, e.g. pi.dev).
- Fix invalid links in two posts: tag/Pi.dev -> tag/pi.dev,
  2026-07-13-synthetic-tdd.md -> synthetic-tdd.
- Fix test warnings: use Plug.Test deprecation, unused import,
  runtime-defined TestBlogValid module.
- Add regression tests for HTML extraction and tag page links.
This commit is contained in:
Firehose Bot
2026-10-08 08:43:51 +01:00
parent 127eb474d2
commit c5db0cbda8
7 changed files with 80 additions and 10 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
defmodule Blogex.RouterTest do
use ExUnit.Case
use Plug.Test
import Plug.Test
import Blogex.Test.PostBuilder
alias Blogex.Test.FakeBlog