Add server-side Mermaid flowchart diagram rendering to Markdown

Introduce server-side SVG rendering for Mermaid flowcharts and graph
diagrams (both 'graph' and 'flowchart' in TD, TB, LR, RL, BT orientations)
embedded in Gitiles Markdown documents.

Example rendering:
https://imgur.com/a/JMuzziu

Key components:
- AST Parser: Token-based recursive scanner handling all standard node
  shapes (rectangle, rounded, stadium, subroutine, cylinder, circle,
  hexagon, diamond, asymmetric flag), full edge matrix (solid, dashed,
  thick, arrows, lines, bidirectional), infix/inline edge labels,
  multi-node ampersand chaining (e.g. A & B --> C & D), and nested
  subgraphs with direction overrides.
- Layered Layout Engine: Sugiyama-inspired DAG layout supporting Coffman-
  Graham layering, barycentric crossing minimization, connected
  component partitioning for isolated subgraphs, lateral edge routing,
  and cycle-breaking loopback paths.
- Security & Hardening: Clean AST-to-SVG emission ensuring zero HTML/DOM
  injection, strictly escaping XML text/tspans, eliminating raw
  <foreignObject>/<iframe> elements, and ignoring malicious click/style
  directives.
- Fallback Mechanism: Safely falls back to raw <pre class="mermaid">
  when diagrams are unsupported or malformed.
- Test Coverage: 100% test line coverage with comprehensive unit,
  integration, and security attack test suites.

Bug: b/490107924
Change-Id: I72ddb3eb67c2513c22444b62581ebd04aaa4afd2
TAG=agy
CONV=85f7f320-abab-4b77-9892-70da2847776b
8 files changed
tree: 8b469807116441792b9576cc715a0d0ec59844db
  1. .settings/
  2. Documentation/
  3. java/
  4. javatests/
  5. lib/
  6. modules/
  7. resources/
  8. tools/
  9. .bazelignore
  10. .bazelrc
  11. .bazelversion
  12. .gitignore
  13. .gitmodules
  14. .mailmap
  15. .zuul.yaml
  16. BUILD
  17. COPYING
  18. external_deps.lock.json
  19. fake_pom_deploy.xml
  20. MODULE.bazel
  21. MODULE.bazel.lock
  22. navbar.md
  23. README.md
  24. version.bzl
README.md

Gitiles - A simple JGit repository browser

Gitiles is a simple repository browser for Git repositories, built on JGit. Its guiding principle is simplicity: it has no formal access controls, no write access, no fancy Javascript, etc.

Gitiles automatically renders *.md Markdown files into HTML for simplified documentation. Refer to the Markdown documentation for details.

Configuration

Gitiles is configurable in a git-style configuration file named gitiles.config. Refer to the configuration documentation for details.

Bugs

Use gerrit's issue tracker to file bugs.

Contributing to Gitiles

Please refer to the Developer Guide.