Skip to content

Commit 49ac97b

Browse files
committed
use default rendering for button
1 parent 8928e0e commit 49ac97b

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

packages/nuemark/src/render-tag.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ const TAGS = {
4343
return elem(attr.popover ? 'dialog' : name, attr, html)
4444
},
4545

46-
button(data) {
47-
const { href } = data
48-
const label = this.renderInline(data.label || data._) || this.innerHTML || ''
49-
50-
return href ? elem('a', { ...this.attr, href, role: 'button' }, label) :
51-
elem('button', this.attr, label)
52-
},
53-
5446
define() {
5547
const html = this.sections?.map((blocks, i) => {
5648
const { attr, text } = blocks[0]

packages/nuemark/test/tag.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ test('[table] empty cells', () => {
213213

214214
test('[button] inline label', () => {
215215
const html = renderLines(['[button href="/" "Hey, *world*"]'])
216-
expect(html).toBe('<a href="/" role="button">Hey, <em>world</em></a>')
216+
expect(html).toBe('<button href="/">Hey, <em>world</em></button>')
217217
})
218218

219219
test('[button] nested label', () => {
220220
const html = renderLines(['[button href=/]', ' ![](/joku.png)'])
221-
expect(html).toStartWith('<a href="/" role="button"><img src="/joku.png"')
221+
expect(html).toStartWith('<button href="/"><p><img src="/joku.png"')
222222
})
223223

224224

@@ -265,7 +265,7 @@ test('[svg]', () => {
265265

266266
test('[svg] nested in [button]', () => {
267267
const html = renderLines(['[button href="/"]', ` [svg ${svgpath}] *Yo*`])
268-
expect(html).toBe('<a href="/" role="button"><svg class="icon"/> <em>Yo</em></a>')
268+
expect(html).toBe('<button href="/"><p><svg class="icon"/> <em>Yo</em></p></button>')
269269
})
270270

271271

0 commit comments

Comments
 (0)