Skip to content

Commit

Permalink
fix: handle double byte characters
Browse files Browse the repository at this point in the history
  • Loading branch information
benjypng committed Oct 16, 2023
1 parent 4a57082 commit bed1c43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/features/parse/manual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ date:: ${getDateForPage(parsedStart, logseq.settings!.preferredDateFormat)}`;
const checkTime = checkIfChronoObjHasTime(chronoBlock[0]!.start);
content = content.replace(parsedText, "");
content = `${content}
SCHEDULED: <${getScheduledDateDay(parsedStart)}${checkTime}>`;
SCHEDULED: <${getScheduledDateDay(parsedStart)}${checkTime}>`;
return content;
}
case flag === deadlineChar: {
if (checkIfUrl(content)) return ""; // Don't parse URLs
const checkTime = checkIfChronoObjHasTime(chronoBlock[0]!.start);
content = content.replace(parsedText, "");
content = `${content}
DEADLINE: <${getDeadlineDateDay(parsedStart)}${checkTime}>`;
DEADLINE: <${getDeadlineDateDay(parsedStart)}${checkTime}>`;
return content;
}
default: {
Expand Down
6 changes: 3 additions & 3 deletions src/features/parse/semi-auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export const semiAutoParse = (

if (scheduledOrDeadline === "SCHEDULED") {
content = `${content}
${getScheduledDateDay(parsedStart)}`;
${getScheduledDateDay(parsedStart)}`;
} else {
content = `${content}
${getDeadlineDateDay(parsedStart)}`;
${getDeadlineDateDay(parsedStart)}`;
}
return content;
}
Expand All @@ -71,7 +71,7 @@ const callback = async (mutationsList: MutationRecord[]): Promise<void> => {
m.type === "childList" &&
m.removedNodes.length > 0 &&
(m.removedNodes[0]! as HTMLElement).className ===
"editor-inner block-editor"
"editor-inner block-editor"
) {
const uuid = (m.target as HTMLElement)
.closest('div[id^="ls-block"]')
Expand Down

0 comments on commit bed1c43

Please sign in to comment.