QDG Knowledge Base Read-only viewer QWebHub
bugs

Bugs and Integration Issues

Version 2 · Document and resolve Markdown table and fenced-code rendering

Bugs and Integration Issues

Resolved: QDG KB Viewer helpers were defined but not consumed by QWebHub settings

Status: Resolved

Symptoms

QDG KB Viewer was correctly registered once in qwebhub/modules.py, but QWebHub failed when loading or serving the module because its database alias and module static directories were not active in Django settings.

Cause

The integration had correctly added qdgwiki_alias() and module_static_dirs() to qwebhub/config.py, matching the existing QWebHub configuration patterns. The final wiring step was missing: qwebhub/settings.py did not consume those helpers.

Defining configuration helpers alone does not change Django's runtime configuration.

Resolution

qwebhub/settings.py must include both integrations:

DATABASES = {
    "default": config.default_database(),
    "qdgwiki": config.qdgwiki_alias(),
}

STATICFILES_DIRS = [
    *config.module_static_dirs(enabled_django_modules()),
]

Preserve any existing static directories when merging the second setting. The exact default-database helper name may vary; the required invariant is that the qdgwiki alias calls config.qdgwiki_alias().

Verification

  1. Run the QWebHub Django system check.
  2. Confirm DATABASES["qdgwiki"] exists and selects the qdgwiki schema.
  3. Run findstatic qdgkb_viewer/styles.css and confirm the viewer stylesheet is found.
  4. Request /knowledge-base/ and a known KB page through QWebHub; both should return HTTP 200.

Durable integration rule

Register QDG KB Viewer through one module descriptor in modules.py. Keep database and static-path construction in config.py. Always complete the integration by plugging those helpers into DATABASES and STATICFILES_DIRS in settings.py; do not add special-case routing or static code elsewhere in the hub.

Resolved: Markdown tables displayed as pipe-delimited text

Status: Resolved

Symptoms

GitHub-style Markdown tables appeared as a single pipe-delimited paragraph in pages such as the updatewiki Quick Reference. Fenced code blocks rendered, but their presentation and overflow behavior needed explicit regression coverage.

Cause

QDG KB Viewer initialized markdown-it-py with the strict commonmark preset. CommonMark supports fenced code blocks but does not enable the optional table rule.

Resolution

Enable the Markdown-It table rule while keeping embedded HTML disabled. Retain native fenced-code rendering, escape code contents, and style tables and code blocks with contained horizontal overflow.

Verification

  • Unit tests assert semantic <table> output for pipe-table Markdown.
  • Unit tests assert language-classed <pre><code> output and HTML escaping for fenced code.
  • The live Quick Reference renders two tables and nine fenced code blocks.
Updated by Codex on Aug. 1, 2026, 10:51 p.m. · Task: Support Markdown tables and code snippets in QDG KB Viewer