Skip to content

Commit

Permalink
REVERT: Remove automated glossing of word literal line
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhieb committed Mar 17, 2024
1 parent 685e57e commit 47d50d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/words/literal.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import createGlossLine from '../utilities/createGlossLine.js'
import addEmphasis from '../utilities/addEmphasis.js'

const cssClass = `wlt`

export default function createLiteral(data, options) {
export default function createLiteral(data, { analysisLang }) {

if (!data) return ``

if (typeof data === `string`) {
return createGlossLine(data, options.analysisLang, cssClass, options)
const lang = analysisLang ? `lang='${ analysisLang }'` : ``
return `<span class=wlt ${ lang }>${ addEmphasis(data) }</span>`
}

let html = ``

for (const lang in data) {
html += createGlossLine(data[lang], lang, cssClass, options)
const tln = data[lang]
html += `<span class=wlt lang='${ lang }'>${ addEmphasis(tln) }</span>`
}

return html
Expand Down
4 changes: 2 additions & 2 deletions test/words.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ describe(`words`, function() {

})

it(`supports glosses`, async function() {
it(`supports (manual) glosses`, async function() {

const scription = `
\\w qasi hix cuyi
\\wlt man ERG he.went
\\wlt man <abbr>erg</abbr> he.went
`

const { dom } = await parse(scription, { glosses: true })
Expand Down

0 comments on commit 47d50d0

Please sign in to comment.