Fix plugin ID, package metadata, and formatter consistency issues
- Correct plugin ID in manifest.json to match folder name (obsidian-unicode-formatter) - Update package.json name and description from sample template defaults - Make markdownToLinkedIn handle both '- ' and '* ' list markers - Enhance cleanText to also strip em-dash, arrow, and numbered-list prefixes
This commit is contained in:
+9
-2
@@ -14,7 +14,14 @@ export function transformText(text: string, style: FormatStyle): string {
|
||||
}
|
||||
|
||||
export function cleanText(text: string): string {
|
||||
return [...text].map(ch => UNICODE_TO_ASCII_MAP.get(ch) ?? ch).join("");
|
||||
return text.split("\n").map(line => {
|
||||
if (line.startsWith("— ")) line = line.slice(2);
|
||||
else if (line.startsWith("→ ")) line = line.slice(2);
|
||||
|
||||
line = line.replace(/^\(\d+\) /, "").replace(/^\d+\/ /, "");
|
||||
|
||||
return [...line].map(ch => UNICODE_TO_ASCII_MAP.get(ch) ?? ch).join("");
|
||||
}).join("\n");
|
||||
}
|
||||
|
||||
export function bulletToEmdash(text: string): string {
|
||||
@@ -79,7 +86,7 @@ export function markdownToLinkedIn(text: string): string {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line.startsWith("- ")) {
|
||||
if (line.startsWith("- ") || line.startsWith("* ")) {
|
||||
if (!inListContext) {
|
||||
for (let i = 0; i < pendingBlanks; i++) output.push("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user