diff --git a/package-lock.json b/package-lock.json index 70dabc1..cb4f4d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "license": "MIT", "dependencies": { - "@digitallinguistics/scription2dlx": "^0.12.3" + "@digitallinguistics/scription2dlx": "^0.13.1" }, "devDependencies": { "@digitallinguistics/eslint-config": "^0.3.0", @@ -43,9 +43,9 @@ } }, "node_modules/@digitallinguistics/scription2dlx": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/@digitallinguistics/scription2dlx/-/scription2dlx-0.12.3.tgz", - "integrity": "sha512-i9qY4nYKLu2k3ThATp+Ax5hCX67ApdTR12NY9FKIYQlgjtCY433lV9DW5eU5cuY/Z8mfyJwSqQ1x2iLELP+ijg==" + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/@digitallinguistics/scription2dlx/-/scription2dlx-0.13.1.tgz", + "integrity": "sha512-gLC7fYKrCD0xud9D4eVYWaLgYG5viiYO66kogOZtx9Znols6lMf9AOy2BmukSOJDcN2hdZz1EAqJKQ8PKw5hNw==" }, "node_modules/@esbuild/android-arm": { "version": "0.19.5", @@ -2486,9 +2486,9 @@ "requires": {} }, "@digitallinguistics/scription2dlx": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/@digitallinguistics/scription2dlx/-/scription2dlx-0.12.3.tgz", - "integrity": "sha512-i9qY4nYKLu2k3ThATp+Ax5hCX67ApdTR12NY9FKIYQlgjtCY433lV9DW5eU5cuY/Z8mfyJwSqQ1x2iLELP+ijg==" + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/@digitallinguistics/scription2dlx/-/scription2dlx-0.13.1.tgz", + "integrity": "sha512-gLC7fYKrCD0xud9D4eVYWaLgYG5viiYO66kogOZtx9Znols6lMf9AOy2BmukSOJDcN2hdZz1EAqJKQ8PKw5hNw==" }, "@esbuild/android-arm": { "version": "0.19.5", diff --git a/package.json b/package.json index 84a1a3e..7aa9010 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,12 @@ "stop-only": "stop-only --folder src", "test": "mocha test/*.test.js" }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@digitallinguistics/scription2dlx": "^0.13.1" + }, "devDependencies": { "@digitallinguistics/eslint-config": "^0.3.0", "@web/parse5-utils": "^2.0.2", @@ -40,11 +46,5 @@ "mocha": "^10.2.0", "parse5": "^7.1.2", "stop-only": "^3.3.1" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@digitallinguistics/scription2dlx": "^0.12.3" } } diff --git a/src/lines/translation.js b/src/lines/translation.js index 2b4db73..815b6fc 100644 --- a/src/lines/translation.js +++ b/src/lines/translation.js @@ -1,14 +1,16 @@ +import addEmphasis from '../utilities/addEmphasis.js' + export default function createTranslation(data) { if (typeof data === `string`) { - return `
${ data }
` + return `${ addEmphasis(data) }
` } let html = `` for (const lang in data) { const tln = data[lang] - html += `${ tln }
` + html += `${ addEmphasis(tln) }
` } return html diff --git a/src/utilities/addEmphasis.js b/src/utilities/addEmphasis.js new file mode 100644 index 0000000..4bb3844 --- /dev/null +++ b/src/utilities/addEmphasis.js @@ -0,0 +1,5 @@ +const emRegExp = /\*(?