Skip to content

Commit

Permalink
fix unnamed block tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Feb 4, 2025
1 parent a99e432 commit 8b279b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nuemark/src/parse-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function parseBlocks(lines, capture) {
// tag
if (c == '[' && trimmed.endsWith(']') && !trimmed.includes('][')) {
const tag = parseTag(line.slice(1, -1))
block = { is_tag: true, ...tag, body: [] }
block = { is_tag: true, ...tag, name: tag.name || 'div', body: [] }
return blocks.push(block)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/nuemark/src/render-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function renderIcon(name, symbol, icon_dir) {

export function renderTag(tag, opts = {}) {
const tags = { ...TAGS, ...opts.tags }
const tag_fn = !tag.name || tag.to_block ? 'block' : tag.to_inline ? 'inline' : tag.name
const tag_fn = tag.to_block ? 'block' : tag.to_inline ? 'inline' : tag.name
const fn = tags[tag_fn]

if (!fn) {
Expand Down

0 comments on commit 8b279b6

Please sign in to comment.