Skip to content

Releases: r74tech/wdpr

@wdprlib/render@3.0.0

Choose a tag to compare

@r74tech r74tech released this 27 Jun 11:08
fc37fc7

3.0.0 (2026-06-27)

🩹 Fixes

  • parser/render: [[image]] が含まれる paragraph の

    wrap を Wikidot 本家挙動に合わせる (#51)

❤️ Thank You

@wdprlib/parser@4.1.0

Choose a tag to compare

@r74tech r74tech released this 27 Jun 12:22
bdef66a

4.1.0 (2026-06-27)

🩹 Fixes

  • parser: ListPagesのtags@URLで/tag URLを解決する (ecd482e)

❤️ Thank You

  • r74tech

@wdprlib/parser@4.0.0

Choose a tag to compare

@r74tech r74tech released this 27 Jun 11:07
9da0cf8

4.0.0 (2026-06-27)

🩹 Fixes

  • parser/render: [[image]] が含まれる paragraph の

    wrap を Wikidot 本家挙動に合わせる (#51)

❤️ Thank You

@wdprlib/render@2.1.0

Choose a tag to compare

@r74tech r74tech released this 10 Jun 13:18
0ee0fd6

2.1.0 (2026-06-10)

🚀 Features

  • parser/ast: opener-embedded [[#if]] / [[#expr]] / [[#ifexpr]] と [[iftags]] bare prefix 対応 (#50)

🧱 Updated Dependencies

  • Updated @wdprlib/ast to 2.1.0

❤️ Thank You

@wdprlib/parser@3.2.0

Choose a tag to compare

@r74tech r74tech released this 10 Jun 13:17
0ee0fd6

3.2.0 (2026-06-10)

🚀 Features

  • parser/ast: opener-embedded [[#if]] / [[#expr]] / [[#ifexpr]] と [[iftags]] bare prefix 対応 (#50)

🧱 Updated Dependencies

  • Updated @wdprlib/ast to 2.1.0

❤️ Thank You

@wdprlib/parser@3.1.2

Choose a tag to compare

@r74tech r74tech released this 10 Jun 03:33
d3c3ada

3.1.2 (2026-06-10)

🩹 Fixes

  • parser: [[include]] の終端 ]] 直後の余分な ] を value 側に吸収 (#49)

❤️ Thank You

@wdprlib/ast@2.1.0

Choose a tag to compare

@r74tech r74tech released this 10 Jun 13:18
0ee0fd6

2.1.0 (2026-06-10)

🚀 Features

  • parser/ast: opener-embedded [[#if]] / [[#expr]] / [[#ifexpr]] と [[iftags]] bare prefix 対応 (#50)

❤️ Thank You

@wdprlib/parser@3.1.1

Choose a tag to compare

@r74tech r74tech released this 05 Jun 08:49
35de09f

3.1.1 (2026-06-05)

🩹 Fixes

  • parser: [[include]] ディレクティブの終端 ]] 直後の余分な ] を許容 (#48)

❤️ Thank You

@wdprlib/runtime@1.0.3

Choose a tag to compare

@r74tech r74tech released this 04 Jun 11:47
5f1046f

1.0.3 (2026-06-04)

🩹 Fixes

  • runtime: 狭い viewport で footnote tooltip がはみ出る問題を修正 (#39)

❤️ Thank You

@wdprlib/render@2.0.0

Choose a tag to compare

@r74tech r74tech released this 04 Jun 11:47
4658f54

2.0.0 (2026-06-04)

🚀 Features

  • ⚠️ ast, parser, render: WikitextSettings.allowHtmlBlocksを追加し[[html]]ブロックを context 別に無効化可能に (#46)

🩹 Fixes

  • render: style属性内のurl()を安全なschemeで許可 (#40)

⚠️ Breaking Changes

  • ast, parser, render: WikitextSettings.allowHtmlBlocksを追加し[[html]]ブロックを context 別に無効化可能に (#46)
    WikitextSettings に必須プロパティ allowHtmlBlocks が
    追加された。手書きで WikitextSettings を構築している消費者は
    allowHtmlBlocks フィールドの追加が必要。createSettings(mode) を経由
    していれば影響なし。
    • feat(parser)!: allowHtmlBlocks=false で [[html]] を黙って消費
      opener の ]] を検証してから settings.allowHtmlBlocks === false を判定。
      disabled 時はブロック全体を消費して空要素 (success:true / elements:[]) を
      返し、ctx.htmlBlocks には push しない。close が見つからない場合も EOF まで
      消費して同じく空要素を返す (unclosed-block warning + html-block-disabled
      info の両方を emit)。中身が text として漏れない。
      malformed opener (closing ]] 欠落) は従来どおり success:false で
      fallback する。enabled 時の挙動は完全維持。
      BREAKING CHANGE: WikitextSettings.allowHtmlBlocks が false の context
      では [[html]] が AST にも html-blocks 配列にも出ない。
    • feat(render)!: allowHtmlBlocks=false で html element を出力しない
      renderHtmlBlock の先頭で ctx.settings.allowHtmlBlocks === false を判定し
      早期 return。nextHtmlBlockIndex() の counter advance や htmlBlockUrl
      resolver 呼び出しより前に置くことで、disabled-but-still-in-AST な
      ブロック (手組み AST、キャッシュ AST、別 parser 由来) でも何も出力しない。
      これによりパース側で settings ゲートが効かないパス (例: 手組み AST の
      直接 render) でも enforcement boundary が保てる。
      BREAKING CHANGE: WikitextSettings.allowHtmlBlocks が false の context
      では html element をレンダしない (空)。
    • test: allowHtmlBlocks の parser/render 両側のテスト追加
      parser (tests/unit/parser/settings.test.ts):
    • createSettings 既定値 (page=true / draft, forum-post, direct-message=false)
    • enabled (page): [[html]] が html element になり html-blocks に push される
    • disabled (draft): element 出ず html-blocks 空、html-block-disabled diagnostic、本文に漏れない
    • disabled + unclosed: EOF まで consume、unclosed-block + html-block-disabled 両方 emit、漏れない
    • disabled + 周囲非干渉: 前後の paragraph は残る
    • forum-post / direct-message でも disabled になる
      render (tests/unit/render/settings.test.ts):
    • enabled: iframe が出る
    • disabled: 手組み AST に html element があっても iframe 出ない (enforcement boundary)
    • disabled: htmlBlockUrl resolver が呼ばれない
    • fix(parser): allowHtmlBlocks=false での leak と close-detection を強化
      3 件の漏れ・誤検出を修正:
    1. (High) close-detection の修正
      parseBlockName で名前が "html" と一致した時点で foundClose=true に
      していたため、malformed [[/html no-close (BLOCK_CLOSE 欠落) で close
      と誤認識し、後続テキストが leak する可能性があった。BLOCK_CLOSE まで
      reach できることを確認してから close と認める実装に変更 (whitespace は
      許容)。これにより disabled 時の unclosed パスも常に EOF まで consume
      する。
    2. (Medium) text-level の [[html]] strip pre-pass を追加
      block-rule の gate だけでは段落内 before [[html]]X[[/html]] after
      のような inline-position occurrence を捕まえられない (block dispatcher
      が mid-paragraph トークンに到達しない)。Wikidot 互換の非貪欲 regex で
      parse 開始時に text-level で strip し、両ポジションで漏れない設計に変更。
      parse() に stripDisabledHtmlBlocks を追加。
    3. (Low) disabled 時の contents 累積をスキップ
      disabled では body を破棄するため、token.value を contents に積む処理
      をガード。大きな入力でのメモリ/CPU を節約。
      test: 段落内 inline 漏れ防止 + malformed close 漏れ防止 のケースを追加。
    • refactor(parser): allowHtmlBlocks gate を inline rule で実装 (text-level pre-pass 廃止)
      text-level pre-pass の問題点を洗い直して再設計:
    1. (High) Parser class 直接使用で pre-pass がバイパスされる
    2. (High) closed のみ strip、mid-paragraph unclosed が漏れる
    3. (Medium) text-level pre-pass が [[code]]/[[html]] 等 raw 内も削除
    4. (Medium) strip 後の lex で diagnostic 位置がずれる
    5. (Medium) pre-pass の gate が truthiness、rule/render は === false
      → text-level pre-pass を廃止し、inline html rule 追加で再設計:
    • packages/parser/src/parser/preprocess/strip-disabled-html.ts 削除
    • parse() を元に戻す
    • packages/parser/src/parser/rules/inline/html.ts (新規 htmlInlineRule):
      • allowHtmlBlocks !== false: success:false (従来挙動維持)
      • === false: [[html]]...[[/html]] を inline で消費、空要素返す
      • close-detection は BLOCK_CLOSE まで verify (whitespace 許容)
      • unclosed: NEWLINE+NEWLINE (blank line) で停止 (後続 paragraph 保護)
    • block rule にも同じ blank-line 停止を追加
    • inline rules 配列に登録 (commentRule の直後)
      これで5件すべて解消:
    1. rule 自体が parse 時に走るので Parser 直接使用でも gate される
    2. inline rule が mid-paragraph closed/unclosed 両方扱う
    3. [[code]]/[[html]] 内は block rule で raw 扱いされ inline rule は到達しない
    4. source mutation なしで位置情報そのまま
    5. すべて === false に統一
      test 追加: Parser 直接使用 / blank-line で stop / code 内 [[html]] 保護
    • fix(parser): enabled html block の空行誤認 + close 末尾 whitespace 漏れを修正
      2 件のバグを修正:
    1. (High) blank-line stop が enabled でも効き、空行を含む valid [[html]]
      block が page mode で壊れる。例: [[html]]\n

      one

      \n\n

      two

      \n[[/html]]
      → blank-line stop を disabled 時のみに限定。
    2. (Medium) close detection は [[/html ]] (whitespace before ]]) を
      許容するが、close 消費側が whitespace を skip しておらず ]] が paragraph
      text に漏れていた。close 消費側にも whitespace skip を追加。
      test: 空行入り valid html block / whitespace 付き close tag のケース追加。
    • fix(parser): disabled でも closed [[html]] の body 内空行で漏れていた問題を修正
      disabled mode で blank-line stop が close より先に発火し、空行を含む
      closed [[html]] (例: [[html]]\n

      one

      \n\n

      two

      \n[[/html]]) の
      後半

      two

      と [[/html]] が paragraph text に漏れていた。
      修正: 事前の forward lookahead で real close 存在を確認する
      lookaheadHasHtmlClose ヘルパを追加し、close が ahead に存在する場合は
      blank-line stop を抑止。close 不在 (truly unclosed) の時のみ blank-line
      stop が効く。block rule / inline rule 両方に適用。
      regression test: disabled mode で空行入り closed block が完全に消費される
      ことを確認。

❤️ Thank You