Skip to content

Commit

Permalink
NEW: Support emphasis in phonemic transcription
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhieb committed Dec 18, 2023
1 parent f1a0ddd commit 295df5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lines/transcription.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import addEmphasis from '../utilities/addEmphasis.js'

export default function createTranscription(data) {

let html = ``

for (const ortho in data) {
const txn = data[ortho]
html += `<p class=txn data-ortho='${ ortho }'>${ txn }</p>`
html += `<p class=txn data-ortho='${ ortho }'>${ addEmphasis(txn) }</p>`
}

return html
Expand Down
17 changes: 17 additions & 0 deletions test/lines.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,23 @@ describe(`lines`, function() {

})

it(`renders emphasis`, function() {

const scription = `
\\txn wax*d*ungu qasi
\\m waxt-qungu qasi
\\gl day-one man
\\tln one day a man
`

const { dom } = parse(scription)
const txn = findElementByClass(dom, `txn`)
const b = findElement(txn, el => getTagName(el) === `b`)

expect(getTextContent(b)).to.equal(`d`)

})

})

describe(`source`, function() {
Expand Down

0 comments on commit 295df5b

Please sign in to comment.