From eb4b713e9d5c66bd05e99d3dc6ff5e1b7df93e7c Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:13:56 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20docx=20import=20missing=20lesson=20conten?= =?UTF-8?q?t=20=E2=80=94=20include=20h1-h6=20block=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mammoth outputs week/quiz headings as
. The
block-element regex only matched , so all headings were skipped and no
lessons were ever created. Expand regex to h[1-6]|p|ul|ol and treat any
h-tag as a heading unconditionally.
Co-Authored-By: Claude Sonnet 4.6 is a heading only if its sole content is
+ const isHeading = /^h[1-6]$/.test(tag) || /^[^<]+<\/strong>\s*$/.test(inner.trim());
elements.push({ kind: isHeading ? 'heading' : 'para', text });
} else {
const items = [...inner.matchAll(/