Skip to content

Commit 685e57e

Browse files
committed
FIX: Words have incorrect number of lines
1 parent 2797395 commit 685e57e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/words/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function createWords(words, options) {
1111

1212
for (const word of words) {
1313

14+
1415
const glosses = createGlosses(word.gloss, options)
1516
const literal = createLiteral(word.literal, options)
1617
const morphemes = createMorphemes(word.analysis, options)

src/words/transcription.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default function createTranscription(data, { targetLang }) {
77

88
for (const ortho in data) {
99
const txn = data[ortho]
10+
if (!txn) continue
1011
html += `<span class=w data-ortho='${ ortho }' ${ lang }>${ addEmphasis(txn) }</span>`
1112
}
1213

test/words.test.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ describe(`words`, function() {
4646

4747
describe(`word transcription`, function() {
4848

49+
it(`has the correct number of lines`, async function() {
50+
51+
const scription = `
52+
ninakupenda
53+
ni-na-ku-pend-a
54+
1SG.SUBJ-PRES-2SG.OBJ-love-IND
55+
I love you`
56+
57+
const { dom } = await parse(scription)
58+
const word = findElementByClass(dom, `word`)
59+
60+
expect(word.childNodes).to.have.length(2)
61+
62+
})
63+
4964
it(`renders in multiple orthographies`, async function() {
5065

5166
const scription = `
@@ -282,7 +297,7 @@ describe(`words`, function() {
282297
I love you
283298
`
284299

285-
const { dom } = await parse(scription, { glosses: true })
300+
const { dom, html } = await parse(scription, { glosses: true })
286301
const glosses = findElements(dom, el => getTagName(el) === `abbr`)
287302
const [person, num] = glosses
288303

0 commit comments

Comments
 (0)