diff --git a/src/words/literal.js b/src/words/literal.js index 5e1b12b..cada065 100644 --- a/src/words/literal.js +++ b/src/words/literal.js @@ -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 `${ addEmphasis(data) }` } let html = `` for (const lang in data) { - html += createGlossLine(data[lang], lang, cssClass, options) + const tln = data[lang] + html += `${ addEmphasis(tln) }` } return html diff --git a/test/words.test.js b/test/words.test.js index c5112b0..86a54fa 100644 --- a/test/words.test.js +++ b/test/words.test.js @@ -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 erg he.went ` const { dom } = await parse(scription, { glosses: true })