Feature/design code block - #177
Merged
Merged
Conversation
Merge pull request #152 from rowicy/posts_riiim
コードブロックをリッチに
Closed
naoki-00-ito
approved these changes
Aug 13, 2026
naoki-00-ito
left a comment
Member
There was a problem hiding this comment.
@riiimparm
LGTM!
まとめ表(フロンティマター的な指定一覧)
がわかりやすいのでreadmeにも書いておいても良いかなと思ったけど、なくても問題はないのでお任せします!
Added Markdown syntax guidelines and Mermaid diagram instructions.
Collaborator
Author
|
たしかに。READMEに追記しました! |
riiimparm
added a commit
that referenced
this pull request
Aug 13, 2026
developにマージされたastro-expressive-code対応(PR #177)により、 生HTMLとして埋め込んだmermaidのpre/codeも1行ずつ.ec-line divで ラップされるようになった。code.textContentだけでは行間の改行が 失われて1行に潰れてしまい、flowchart/class diagram/gitGraph/ mindmapなどインデントや改行に依存する構文でパースエラーになる ことを確認した。.ec-lineがあれば行ごとのtextContentを改行で 結合し直すことで解消し、12種類のダイアグラム全てで再検証した。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
コードブロックに astro-expressive-code を使用
テスト用md
JSON
JSON はコメート構文を持たないため、説明は本文側に記載します(
titleはそのまま使えます)。{ "name": "my-astro-app", "version": "1.0.0", "type": "module" }Bash
# title="..." でファイルパスを表示する例 npm run build npm run deploy2. wrap(長い行の折り返し)
3. マーカーライン(行ハイライト)
行番号を
{ }で指定してハイライトします。範囲・複数指定も可能です。行単位の追加・削除マーカー(ins / del)
4. ワードマーカー(単語・正規表現の強調)
文字列で囲むと単語単位のハイライト、
/.../で正規表現ハイライトになります。単語単位の追加・削除マーカー(ins= / del=)
5. diff 構文
diff言語を使うと+/-プレフィックスでそのまま差分表示になります。// diff + lang でシンタックスハイライト付き diff にする例 { "name": "my-astro-app", - "version": "1.0.0" + "version": "1.1.0" }6. 複合例(title + マーカーライン + ワードマーカー + wrap)
7. ターミナル風フレーム(frame="terminal")
# frame="terminal" でターミナルウィンドウ風に見せる例 npm create astro@latest8. 行番号表示(showLineNumbers)
9. 折りたたみ(collapse)
10. まとめ表(フロンティマター的な指定一覧)
title="..."```ts title="src/a.ts"{2-4}```ts {2-4}ins={n}/del={n}```ts ins={2} del={3}"word"//regex/```ts "greet" /Hi.*!/ins="word"/del="word"```ts ins="foo" del="bar"wrap```ts wrapframe="terminal"```bash frame="terminal"showLineNumbers```ts showLineNumberscollapse={1-3}```ts collapse={1-3}```diff```diff title="x.ts"