Skip to content

Commit

Permalink
fix: use spans for lines and tokens
Browse files Browse the repository at this point in the history
Kinda makes more sense to use inline tags for that.
  • Loading branch information
norskeld committed Jan 15, 2022
1 parent 0157c87 commit 1fa32ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/renderer.ts
Expand Up @@ -58,7 +58,7 @@ export function renderToHtml(
const lineClasses = getLineClasses(lineOptions, ['line']).join(' ')

// Open: line.
append(`<div class="${lineClasses}">`)
append(`<span class="${lineClasses}">`)

if (line.length) {
line.forEach((token) => {
Expand All @@ -72,17 +72,17 @@ export function renderToHtml(
]

append(
`<div class="line-token" style="${cssDeclarations.join('; ')}">${escapeHtml(
`<span class="line-token" style="${cssDeclarations.join('; ')}">${escapeHtml(
content
)}</div>`
)}</span>`
)
})
} else {
append(`<div class="line-token">&nbsp;</div>`)
append(`<span class="line-token">&nbsp;</span>`)
}

// Close: line.
append(`</div>`)
append(`</span>`)
})

// Close: building the lines with code.
Expand Down

0 comments on commit 1fa32ed

Please sign in to comment.