Ignore text inside code blocks

Fixes #1
This commit is contained in:
Kianga 2023-07-14 14:43:50 +02:00
parent 782ddd28d9
commit 6b003e9cc9
Signed by: kianga
SSH Key Fingerprint: SHA256:FsfHSVtt4BSm5AV+MG3KYJplFo8Q8+TWvSeud7Um4Oo
3 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,11 @@ export default class AutoTypographyPlugin extends Plugin {
// Go through all text nodes in the rendered HTML
while ((currentNode = treeWalker.nextNode())) {
// Skip anything inside code blocks
if (currentNode.parentElement?.closest("code") != null) {
continue;
}
let t = currentNode.textContent!;
// convert triple hyphens to em-dash

View File

@ -1,7 +1,7 @@
{
"id": "obsidian-auto-typography",
"name": "Auto-Typography",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Automatically converts ASCII to Unicode typography",
"author": "René Puls",

View File

@ -1,6 +1,6 @@
{
"name": "obsidian-auto-typography",
"version": "1.0.0",
"version": "1.0.1",
"description": "Obsidian plugin that converts ASCII to Unicode typography",
"homepage": "https://github.com/kianga/obsidian-auto-typography",
"bugs": "https://github.com/kianga/obsidian-auto-typography/issues",