Skip to content

fix: escape URLs in PlantUML files to prevent rendering artifacts - #15

Closed
ChS23 wants to merge 6 commits into
Byndyusoft:mainfrom
ChS23:fix/plantuml-url-escaping
Closed

fix: escape URLs in PlantUML files to prevent rendering artifacts#15
ChS23 wants to merge 6 commits into
Byndyusoft:mainfrom
ChS23:fix/plantuml-url-escaping

Conversation

@ChS23

@ChS23 ChS23 commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

Added URL escaping for C4-PlantUML syntax to fix rendering issue where :// was interpreted as italic formatting, causing </size>// artifacts in generated SVG files.

Fixes #8

Added URL escaping for C4-PlantUML syntax to fix rendering issue where `://` was interpreted as italic formatting, causing  `</size>//` artifacts in generated SVG files.
ChS23 added a commit to ChS23/aact that referenced this pull request Oct 25, 2025
Extracted PlantUML generation logic from unit test into reusable src/pumlGenerator.ts module and added scripts/generate-puml.ts CLI tool with configurable options (--config, --output, --title) to enable diagram generation outside of test suite.

Resolves Byndyusoft#7
Depends on Byndyusoft#15
@razonrus

Copy link
Copy Markdown
Member

Спасибо! Почему-то не проходят тесты — из-за изменений, или они и в основной ветке сейчас сломаны? Сам смогу подробнее глянуть чуть позже

@ChS23

ChS23 commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

Спасибо! Почему-то не проходят тесты — из-за изменений, или они и в основной ветке сейчас сломаны? Сам смогу подробнее глянуть чуть позже

Поправил сравнение в тестах

@ChS23 ChS23 closed this May 10, 2026
@ChS23 ChS23 reopened this May 10, 2026
ChS23 and others added 4 commits May 11, 2026 01:55
Reconciles PR Byndyusoft#15 with the v2 refactor that landed on main. Conflicts
resolved by taking main's version for files that were restructured in
v2:

- resources/architecture/generated.puml: v2 changed the generator's
  output (no separate System_Ext mid-file, renamed variables). Took
  main's regenerated structure and re-applied the URL escape via sed
  (https:// to https:~/~/) which is the actual point of this PR.
- examples/banking-plantuml/architecture.test.ts: post-v2 the test no
  longer string-compares PlantUML content, so the c094bd0 'handle
  escaped URLs in architecture test comparisons' commit is obsolete --
  took main's simpler test.
The SVGs in the original PR Byndyusoft#15 were regenerated from the pre-v2
generator output. Post-v2 the .puml content structure is different
(see merge commit), so those SVGs would render against the wrong
diagram structure. Revert SVGs to current main; downstream PlantUML
rendering will regenerate them from the URL-escaped .puml.
Re-applies the test-comparison fix from the original c094bd0 commit,
which was lost when this PR was rebased over v2 (the test moved from
test/architecture.test.ts to examples/banking-plantuml/architecture.test.ts).

Adds unescapePlantUmlUrl helper and uses it in three places:
- check that urls and topics from relations exist in config
- connect to external systems only by API Gateway or kafka
- checkSections helper (used by find diff in configs and uml dependencies)

Without this, the .puml URL escape (https:// to https:~/~/) breaks
string equality against the unescaped URLs in
resources/kubernetes/microservices/*.yml configs.
@ChS23

ChS23 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Закрываю как superseded #19.

Проблема верная (PlantUML читает // в URL как italic-creole → в SVG течёт [https: …]</size>//), но в v3 она решена иначе и в другом месте: escape переехал из теста в генератор и парсер PlantUML (//~// в видимом тексте, разэкранирование на load), плюс перерисованы фикстуры.

Старый diff правит resources/architecture/*, которого в v3 уже нет (переехало в fixtures/*), так что вмёрживать тут нечего.

@ChS23 ChS23 closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Поправить форматы ссылок у синхронных связей в puml

2 participants