@im-nobsidian/core 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4808,6 +4808,31 @@ interface Logger {
4808
4808
  declare function setLogger(logger: Logger): void;
4809
4809
  declare function getLogger(): Logger;
4810
4810
 
4811
+ /**
4812
+ * lookbehind 없이 앞 글을 보는 정규식 — 소스에 `(?<!…)` · `(?<=…)` 를 쓰지 않는다.
4813
+ *
4814
+ * iOS 16.4 앞의 JavaScript 는 lookbehind 를 읽지 못해, 그런 정규식 하나가 든 스크립트 전체가 뜨지 않는다 — 플러그인이
4815
+ * 모바일에서 아예 켜지지 않는다(P11). 커뮤니티 디렉터리의 검사도 데스크톱 전용이 아닌 플러그인의 lookbehind 를
4816
+ * 거절한다. `tests/utils/no-lookbehind.test.ts` 가 소스에 다시 들어오지 않게 막는다.
4817
+ *
4818
+ * `exec` 만 갈아 끼운다 — `replace` · `matchAll` · `split` · `test` 가 모두 `exec` 를 부르므로 쓰는 곳은 바뀌지 않는다.
4819
+ * 맞은 자리의 앞 글이 조건에 맞지 않으면 그 자리를 버리고 다음 글자에서 다시 찾는다. 정규식 맨 앞(또는 마지막
4820
+ * 갈래의 맨 앞)의 lookbehind 와 결과가 같다 — 엔진도 그 자리에서 lookbehind 가 막히면 다음 글자로 넘어간다.
4821
+ */
4822
+ /** 맞은 것을 받나 — `index` 는 맞은 자리, `match` 는 맞은 것(갈래를 가를 때). */
4823
+ type Lookbehind = (text: string, index: number, match: RegExpExecArray) => boolean;
4824
+ declare class LookbehindRegExp extends RegExp {
4825
+ readonly accept: Lookbehind;
4826
+ /** 실제로 찾는 정규식 — `g`(또는 `y`) 로 어느 자리에서든 이어 찾는다. */
4827
+ private readonly scanner;
4828
+ constructor(pattern: string | RegExp, flags?: string, accept?: Lookbehind);
4829
+ exec(text: string): RegExpExecArray | null;
4830
+ }
4831
+ /** `index` 바로 앞의 글자(써로게이트 쌍은 하나로) — 맨 앞이면 "". */
4832
+ declare function charBefore(text: string, index: number): string;
4833
+ /** `(?<![…])` — 바로 앞 글자가 `set`(글자 하나를 보는 정규식)에 맞지 않거나 맨 앞이다. */
4834
+ declare function notAfter(set: RegExp): Lookbehind;
4835
+
4811
4836
  /**
4812
4837
  * 경로 패턴(`paths.include` · `paths.exclude` · `.im-nobsidian-ignore`)을 목록에 대는 VaultFS.
4813
4838
  *
@@ -5096,4 +5121,4 @@ declare function readColumnLayout(lines: readonly string[]): (ColumnPlace | unde
5096
5121
  /** 열 이름표 — `열 2/3 · 50%`. 비율이 없으면 `열 2/3`. */
5097
5122
  declare function columnLabel(place: ColumnPlace): string;
5098
5123
 
5099
- export { BaseFileGenerator, type BaseFileOptions, type BasePropertyOption, type BasePropertySchema, type BaseStatusGroup, type BaseSyncOptions, type BasesFilterNode, type BasesViewMapping, type BasesViewType, BlankLineCollapser, type BookmarkTarget, CONFIG_FILE, CONFLICT_STRATEGIES, type CalendarEntry, type CalloutDesign, CalloutRestorer, CalloutTransformer, ChangeDetector, type ChangeDiff, ColorAnnotator, type ColumnPlace, type CompletenessFailure, type CompletenessLocalSource, type CompletenessOptions, type CompletenessRemoteSource, type CompletenessReport, type Config, ConfigManager, ConfigSchema, type Conflict, ConflictResolver, type ConflictStrategy, ConnectionBoundaryError, ConnectionScopeError, type ConversionContext, type ConversionPath, ConversionPipeline, type ConversionResult, type CoverConfig, type DBEntry, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, type DatabaseCompleteness, type DatabaseMove, type DatabaseSyncConfig, type DatabaseSyncResult, DatabaseSyncer, type DatabaseViewsConfig, type DeferredCode, type DegradeNote, type DesignColor, type DesignLine, type DesignSegment, type DiffHunk, type DiffLine, EmbedResolver, EntryEditor, type FailedOperation, type FidelityClassification, type FidelityContext, type FidelityDefect, type FidelityDefectForm, type FidelitySummary, type FileDownloadResult, FileHandler, type FileInfo, type FileRegistryEntry, type FileStatInfo, type FileSystemEntry, type FileType, type FileUploadResult, FileWatcher, type FilterCondition, FilteredVaultFS, type FolderDatabaseReport, type FolderMoveChange, FrontmatterExtractor, FrontmatterGenerator, type FullScanReason, GITIGNORE_ENTRY, type GatedOperation, type GroupByConfig, type GroupedEntries, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, type IStateDB, type ImageDownloadResult, ImageHandler, type ImageReference, type InferredProperty, InlineAnnotationPreserver, InlineDBParser, type InlineStyle, type LineDiffOptions, type LineRange, type LocalChange, LocalImageRestorer, type LocalMoveAdoption, type LocalScan, type LocalScanOptions, type Logger, MARKER_BRAND, type MappingResult, type MappingType, MathNormalizer, MentionToWikilink, type MergeConflictRegion, type MergeResult, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, type NestedFolderPage, type NestedFolderRecord, NodeVaultFS, type NonMdFileInfo, type NotionAccessCheck, type NotionBlock, NotionBlockBuilder, NotionClient, type NotionClientOptions, type NotionColor, type NotionPageNode, type NotionRichText, type RichTextItem as NotionRichTextItem, type NotionSidecar, OBSIDIAN_CONFIG_DIR, OBSIDIAN_ONLY_PATTERNS, type OperationType, type OutsideVault, type PageCompletenessRemoteSource, type PageCompletenessReport, type PageCover, type PageCreationPlan, type PageIcon, PathFilter, type PathFilterConfig, type PendingOperation, PendingWalError, type PlacementChange, type PlannedRow, type PreserveMarker, PreserveMarkerCollector, PreserveMarkerInjector, type Processor, type ProcessorInput, type ProcessorMetadata, type ProcessorOutput, type ProgressCallback, type ProgressItem, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, type PropertyOption, type PropertyRename, type PropertySchema, type PropertyValue, type PullOptions, type PullResult, type PushOptions, type PushResult, RENDER_LINE_RULES, type ReadOnlySkip, type RecordPendingInput, type RegisterFileInput, type RemoteChange, type RemoteMove, type RemoteMoveSkip, type RemoteObservation, type RemoteScanInfo, type RenameHints, type RenameKind, type RenderFinding, type RenderLineRule, type ResolutionChoice, type ResolutionResult, type RichTextSegment, type RowProgress, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, SIDECAR_SUFFIX, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, type SchemaEdit, type SchemaFollowed, ScopedVaultFS, SidecarGenerator, type SidecarProperty, type SidecarView, StateDB, StateDbLockedError, type StateDbMigration, type StateDbTool, StateDbUnavailableError, StateLock, type StateLockClaim, type StateLockOwner, type StatusOptions, type StatusResult, type StyledRange, SyncBusyError, type SyncDirection, type SyncOptions, SyncOrchestrator, type SyncRecord, type SyncResult, type SyncStatus, TEMPLATE_FOLDER_SETTINGS, type TableLineDesign, type TranslationResult, TreeMapper, UnlinkedVaultError, UnsupportedBlockStripper, type UpsertSyncRecord, type UserBaseFilterFix, type VaultCompletenessReport, type VaultFS, type ViewConfig, ViewDataProvider, type ViewEdit, type ViewPropertyConfig, type ViewRenderData, type ViewType, WIKILINK_LOOKUPS, type WatchSyncOptions, type WatchSyncScope, WatchSyncService, type WikilinkEntry, type WikilinkLookup, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, checkNotionAccess, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, findNestedFolderPages, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isHeadingLine, isHeadingMarkerLine, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, noteNameFromPath, notionIdFromInput, notionIdsEqual, notionPageUrl, obsidianOnlyExcludes, operationLabel, parseDesignColor, parseIgnorePatterns, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, sectionLinesWithHeadingMarkers, setLogger, shortNotionId, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, templateFolders, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };
5124
+ export { BaseFileGenerator, type BaseFileOptions, type BasePropertyOption, type BasePropertySchema, type BaseStatusGroup, type BaseSyncOptions, type BasesFilterNode, type BasesViewMapping, type BasesViewType, BlankLineCollapser, type BookmarkTarget, CONFIG_FILE, CONFLICT_STRATEGIES, type CalendarEntry, type CalloutDesign, CalloutRestorer, CalloutTransformer, ChangeDetector, type ChangeDiff, ColorAnnotator, type ColumnPlace, type CompletenessFailure, type CompletenessLocalSource, type CompletenessOptions, type CompletenessRemoteSource, type CompletenessReport, type Config, ConfigManager, ConfigSchema, type Conflict, ConflictResolver, type ConflictStrategy, ConnectionBoundaryError, ConnectionScopeError, type ConversionContext, type ConversionPath, ConversionPipeline, type ConversionResult, type CoverConfig, type DBEntry, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, type DatabaseCompleteness, type DatabaseMove, type DatabaseSyncConfig, type DatabaseSyncResult, DatabaseSyncer, type DatabaseViewsConfig, type DeferredCode, type DegradeNote, type DesignColor, type DesignLine, type DesignSegment, type DiffHunk, type DiffLine, EmbedResolver, EntryEditor, type FailedOperation, type FidelityClassification, type FidelityContext, type FidelityDefect, type FidelityDefectForm, type FidelitySummary, type FileDownloadResult, FileHandler, type FileInfo, type FileRegistryEntry, type FileStatInfo, type FileSystemEntry, type FileType, type FileUploadResult, FileWatcher, type FilterCondition, FilteredVaultFS, type FolderDatabaseReport, type FolderMoveChange, FrontmatterExtractor, FrontmatterGenerator, type FullScanReason, GITIGNORE_ENTRY, type GatedOperation, type GroupByConfig, type GroupedEntries, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, type IStateDB, type ImageDownloadResult, ImageHandler, type ImageReference, type InferredProperty, InlineAnnotationPreserver, InlineDBParser, type InlineStyle, type LineDiffOptions, type LineRange, type LocalChange, LocalImageRestorer, type LocalMoveAdoption, type LocalScan, type LocalScanOptions, type Logger, type Lookbehind, LookbehindRegExp, MARKER_BRAND, type MappingResult, type MappingType, MathNormalizer, MentionToWikilink, type MergeConflictRegion, type MergeResult, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, type NestedFolderPage, type NestedFolderRecord, NodeVaultFS, type NonMdFileInfo, type NotionAccessCheck, type NotionBlock, NotionBlockBuilder, NotionClient, type NotionClientOptions, type NotionColor, type NotionPageNode, type NotionRichText, type RichTextItem as NotionRichTextItem, type NotionSidecar, OBSIDIAN_CONFIG_DIR, OBSIDIAN_ONLY_PATTERNS, type OperationType, type OutsideVault, type PageCompletenessRemoteSource, type PageCompletenessReport, type PageCover, type PageCreationPlan, type PageIcon, PathFilter, type PathFilterConfig, type PendingOperation, PendingWalError, type PlacementChange, type PlannedRow, type PreserveMarker, PreserveMarkerCollector, PreserveMarkerInjector, type Processor, type ProcessorInput, type ProcessorMetadata, type ProcessorOutput, type ProgressCallback, type ProgressItem, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, type PropertyOption, type PropertyRename, type PropertySchema, type PropertyValue, type PullOptions, type PullResult, type PushOptions, type PushResult, RENDER_LINE_RULES, type ReadOnlySkip, type RecordPendingInput, type RegisterFileInput, type RemoteChange, type RemoteMove, type RemoteMoveSkip, type RemoteObservation, type RemoteScanInfo, type RenameHints, type RenameKind, type RenderFinding, type RenderLineRule, type ResolutionChoice, type ResolutionResult, type RichTextSegment, type RowProgress, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, SIDECAR_SUFFIX, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, type SchemaEdit, type SchemaFollowed, ScopedVaultFS, SidecarGenerator, type SidecarProperty, type SidecarView, StateDB, StateDbLockedError, type StateDbMigration, type StateDbTool, StateDbUnavailableError, StateLock, type StateLockClaim, type StateLockOwner, type StatusOptions, type StatusResult, type StyledRange, SyncBusyError, type SyncDirection, type SyncOptions, SyncOrchestrator, type SyncRecord, type SyncResult, type SyncStatus, TEMPLATE_FOLDER_SETTINGS, type TableLineDesign, type TranslationResult, TreeMapper, UnlinkedVaultError, UnsupportedBlockStripper, type UpsertSyncRecord, type UserBaseFilterFix, type VaultCompletenessReport, type VaultFS, type ViewConfig, ViewDataProvider, type ViewEdit, type ViewPropertyConfig, type ViewRenderData, type ViewType, WIKILINK_LOOKUPS, type WatchSyncOptions, type WatchSyncScope, WatchSyncService, type WikilinkEntry, type WikilinkLookup, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, charBefore, checkNotionAccess, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, findNestedFolderPages, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isHeadingLine, isHeadingMarkerLine, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, notAfter, noteNameFromPath, notionIdFromInput, notionIdsEqual, notionPageUrl, obsidianOnlyExcludes, operationLabel, parseDesignColor, parseIgnorePatterns, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, sectionLinesWithHeadingMarkers, setLogger, shortNotionId, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, templateFolders, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };
package/dist/index.js CHANGED
@@ -118,7 +118,16 @@ var REQUEST_BYTES_MAX = 5e5;
118
118
  var DEFAULT_DOWNLOAD_TIMEOUT_MS = 3e5;
119
119
  function fetchForDownload(fetchFn, url, timeoutMs = DEFAULT_DOWNLOAD_TIMEOUT_MS) {
120
120
  if (timeoutMs <= 0) return fetchFn(url);
121
- return fetchFn(url, { signal: AbortSignal.timeout(timeoutMs) });
121
+ return fetchFn(url, { signal: timeoutSignal(timeoutMs) });
122
+ }
123
+ function timeoutSignal(timeoutMs) {
124
+ if (typeof AbortSignal.timeout === "function") return AbortSignal.timeout(timeoutMs);
125
+ const controller = new AbortController();
126
+ setTimeout(
127
+ () => controller.abort(new DOMException("The operation timed out.", "TimeoutError")),
128
+ timeoutMs
129
+ );
130
+ return controller.signal;
122
131
  }
123
132
 
124
133
  // src/utils/deadline.ts
@@ -5847,6 +5856,69 @@ function decodeMarkerTarget(encoded) {
5847
5856
  var MARKER_URL_CAPTURE = "((?:[^()\\s]|\\([^()]*\\))+)";
5848
5857
  var MARKER_LABEL_CAPTURE = "([^[\\]]+)";
5849
5858
 
5859
+ // src/utils/lookbehind.ts
5860
+ var LookbehindRegExp = class _LookbehindRegExp extends RegExp {
5861
+ accept;
5862
+ /** 실제로 찾는 정규식 — `g`(또는 `y`) 로 어느 자리에서든 이어 찾는다. */
5863
+ scanner;
5864
+ constructor(pattern, flags, accept) {
5865
+ super(pattern, flags);
5866
+ const inherited = pattern instanceof _LookbehindRegExp ? pattern.accept : void 0;
5867
+ const resolved = accept ?? inherited;
5868
+ if (!resolved) throw new TypeError("LookbehindRegExp \uC5D0 \uC55E \uAE00 \uC870\uAC74\uC774 \uC5C6\uC74C");
5869
+ this.accept = resolved;
5870
+ this.scanner = new RegExp(
5871
+ this.source,
5872
+ this.sticky || this.global ? this.flags : `${this.flags}g`
5873
+ );
5874
+ }
5875
+ exec(text) {
5876
+ const keepsIndex = this.global || this.sticky;
5877
+ const start = keepsIndex ? this.lastIndex : 0;
5878
+ this.scanner.lastIndex = start;
5879
+ for (; ; ) {
5880
+ const match = start > text.length ? null : this.scanner.exec(text);
5881
+ if (match === null) {
5882
+ if (keepsIndex) this.lastIndex = 0;
5883
+ return null;
5884
+ }
5885
+ if (this.accept(text, match.index, match)) {
5886
+ if (keepsIndex) this.lastIndex = this.scanner.lastIndex;
5887
+ return match;
5888
+ }
5889
+ if (this.sticky) {
5890
+ this.lastIndex = 0;
5891
+ return null;
5892
+ }
5893
+ this.scanner.lastIndex = match.index + codeUnitsAt(text, match.index, this.unicode);
5894
+ }
5895
+ }
5896
+ };
5897
+ function codeUnitsAt(text, index, unicode) {
5898
+ return unicode && (text.codePointAt(index) ?? 0) > 65535 ? 2 : 1;
5899
+ }
5900
+ function charBefore(text, index) {
5901
+ if (index <= 0) return "";
5902
+ const low = text.charCodeAt(index - 1);
5903
+ const isLow = low >= 56320 && low <= 57343;
5904
+ const high = index >= 2 ? text.charCodeAt(index - 2) : 0;
5905
+ return isLow && high >= 55296 && high <= 56319 ? text.slice(index - 2, index) : text.slice(index - 1, index);
5906
+ }
5907
+ function notAfter(set) {
5908
+ return (text, index) => {
5909
+ const before = charBefore(text, index);
5910
+ return before === "" || !set.test(before);
5911
+ };
5912
+ }
5913
+ function notAfterText(literal) {
5914
+ return (text, index) => !text.slice(Math.max(0, index - literal.length), index).endsWith(literal);
5915
+ }
5916
+ function evenBackslashesBefore(text, index) {
5917
+ let count = 0;
5918
+ while (index - count - 1 >= 0 && text[index - count - 1] === "\\") count++;
5919
+ return count % 2 === 0;
5920
+ }
5921
+
5850
5922
  // src/converter/anchor-links.ts
5851
5923
  function splitAnchor(target) {
5852
5924
  const at = target.indexOf("#");
@@ -5900,7 +5972,11 @@ function anchorBlockOf(block) {
5900
5972
  text: (body?.rich_text ?? []).map((t) => t.plain_text ?? "").join("")
5901
5973
  };
5902
5974
  }
5903
- var ANCHORED_WIKILINK_RE = /(?<!!)\[\[([^[\]|]*#[^[\]|]*?)\\?(?:\|[^[\]]+)?\]\]/g;
5975
+ var ANCHORED_WIKILINK_RE = new LookbehindRegExp(
5976
+ /\[\[([^[\]|]*#[^[\]|]*?)\\?(?:\|[^[\]]+)?\]\]/g,
5977
+ void 0,
5978
+ notAfter(/!/)
5979
+ );
5904
5980
  function anchoredWikilinkTargets(markdown) {
5905
5981
  return [...new Set([...markdown.matchAll(ANCHORED_WIKILINK_RE)].map((m) => m[1].trim()))].filter(
5906
5982
  (target) => splitAnchor(target) !== null
@@ -5911,7 +5987,11 @@ function notionBlockUrl(pageId, blockId) {
5911
5987
  }
5912
5988
 
5913
5989
  // src/converter/pre-processors/wikilink.ts
5914
- var WIKILINK_REGEX2 = /(?<!!)\[\[([^[\]|]+)(?:\|([^[\]]+))?\]\]/g;
5990
+ var WIKILINK_REGEX2 = new LookbehindRegExp(
5991
+ /\[\[([^[\]|]+)(?:\|([^[\]]+))?\]\]/g,
5992
+ void 0,
5993
+ notAfter(/!/)
5994
+ );
5915
5995
  function withoutTableAliasEscape(target) {
5916
5996
  return target.endsWith("\\") ? target.slice(0, -1) : target;
5917
5997
  }
@@ -6144,7 +6224,7 @@ function withoutPrefix(line, prefix) {
6144
6224
  if (line.trimEnd() === prefix.trimEnd()) return "";
6145
6225
  return null;
6146
6226
  }
6147
- var DOUBLE_DOLLAR_RE = /(?<![\\$])\$\$(?!\$)/g;
6227
+ var DOUBLE_DOLLAR_RE = new LookbehindRegExp(/\$\$(?!\$)/g, void 0, notAfter(/[\\$]/));
6148
6228
  var OWN_LINE_DOLLARS_RE = new RegExp(
6149
6229
  String.raw`^(?:[ \t]*>)*[ \t]*(?:\[![^\]]*\][+-]?[ \t]*|${LIST_MARKER_SOURCE}[ \t]+)?\$\$[ \t]*$`
6150
6230
  );
@@ -6276,9 +6356,11 @@ var HEAD_LINE_PARTS_RE = /^([ \t]*(?:>[ \t]*)+)(\[![^\]\s]+\][-+]?)(.*)$/;
6276
6356
  var TITLE_EMBED_RE = /[ \t]*!\[\[([^[\]]+)\]\]/g;
6277
6357
  var MARKDOWN_IMAGE_REGEX = /!\[([^\]]*)\]\(([^)]+)\)/g;
6278
6358
  var VIDEO_HOSTS = ["youtube.com", "youtu.be", "vimeo.com"];
6279
- var STRAY_MEDIA_MARKER_RE = new RegExp(
6280
- `(?<!\u{1F4CE}[^\\n]*)%%\\s*${MARKER_BRAND_RE}:local-(?:image|file):${MARKER_PAYLOAD_CHAR}+?\\s*%%`,
6281
- "gu"
6359
+ var STRAY_MEDIA_MARKER_RE = new LookbehindRegExp(
6360
+ `%%\\s*${MARKER_BRAND_RE}:local-(?:image|file):${MARKER_PAYLOAD_CHAR}+?\\s*%%`,
6361
+ "gu",
6362
+ // 같은 줄의 앞에 📎 이 없다 — 예전 `(?<!📎[^\n]*)`
6363
+ (text, index) => !text.slice(text.lastIndexOf("\n", index - 1) + 1, index).includes("\u{1F4CE}")
6282
6364
  );
6283
6365
  var EmbedResolver = class {
6284
6366
  name = "EmbedResolver";
@@ -6778,7 +6860,7 @@ function containerBlockEnds(lines) {
6778
6860
 
6779
6861
  // src/converter/pre-processors/html-annotation.ts
6780
6862
  var UNDERLINE_REGEX = /<u>([\s\S]*?)<\/u>/g;
6781
- var HIGHLIGHT_REGEX = /(?<!=)==([^=\n]+?)==(?!=)/g;
6863
+ var HIGHLIGHT_REGEX = new LookbehindRegExp(/==([^=\n]+?)==(?!=)/g, void 0, notAfter(/=/));
6782
6864
  var MARK_REGEX = /<mark(?:\s[^>]*)?>([^\n]+?)<\/mark>/g;
6783
6865
  var COLOR_SPAN_REGEX = /<span class="notion-(\w+)(-bg)?">([\s\S]*?)<\/span>/g;
6784
6866
  var SPACED_COLOR_REGEX = new RegExp(
@@ -7500,7 +7582,7 @@ var CommentStripper = class {
7500
7582
  };
7501
7583
 
7502
7584
  // src/converter/pre-processors/footnote-guard.ts
7503
- var FOOTNOTE_TOKEN_REGEX = /(?<!\\)\[\^([^\]\s]+)\]/g;
7585
+ var FOOTNOTE_TOKEN_REGEX = new LookbehindRegExp(/\[\^([^\]\s]+)\]/g, void 0, notAfter(/\\/));
7504
7586
  var FootnoteGuard = class {
7505
7587
  name = "FootnoteGuard";
7506
7588
  order = 12;
@@ -9988,12 +10070,16 @@ function mapOutsideRanges(line, ranges, fn) {
9988
10070
  }
9989
10071
  return out + fn(line.slice(pos));
9990
10072
  }
9991
- var WIKILINK_FORMAT_CHAR_RE = /(?<!\\)([*_~`$])/g;
10073
+ var WIKILINK_FORMAT_CHAR_RE = new LookbehindRegExp(/([*_~`$])/g, void 0, notAfter(/\\/));
9992
10074
  function sendWikilinkText(text) {
9993
10075
  return text.replace(WIKILINK_FORMAT_CHAR_RE, "\\$1");
9994
10076
  }
9995
10077
  var WIKILINK_ESCAPED_RE = /\\([*_~`$<>])/g;
9996
- var PLAIN_WIKILINK_RE = /(?<!!)\[\[(?!notion:)([^[\]\n]+)\]\]/g;
10078
+ var PLAIN_WIKILINK_RE = new LookbehindRegExp(
10079
+ /\[\[(?!notion:)([^[\]\n]+)\]\]/g,
10080
+ void 0,
10081
+ notAfter(/!/)
10082
+ );
9997
10083
  function receiveWikilinkText(markdown) {
9998
10084
  if (!markdown.includes("[[")) return markdown;
9999
10085
  return mapOutsideCodeFences(
@@ -10026,6 +10112,7 @@ function extractInlineDbIds(markdown) {
10026
10112
  }
10027
10113
 
10028
10114
  // src/converter/child-tags.ts
10115
+ var UNESCAPED_UNDERSCORE_RE = new LookbehindRegExp(/_/g, void 0, notAfter(/\\/));
10029
10116
  var CHILD_PAGE_TAG_RE = /<page url="([^"]*)">([\s\S]*?)<\/page>/g;
10030
10117
  var CHILD_DATABASE_TAG_RE = /<database\b([^>]*)>([\s\S]*?)<\/database>/g;
10031
10118
  var ID32_RE = /[a-f0-9]{32}/;
@@ -10109,7 +10196,7 @@ function sendableTag(child) {
10109
10196
  if (child.kind !== "page" || !child.title.includes("_")) return child.tag;
10110
10197
  const close = "</page>";
10111
10198
  const head = child.tag.slice(0, child.tag.length - close.length - child.title.length);
10112
- return `${head}${child.title.replace(/(?<!\\)_/g, "\\_")}${close}`;
10199
+ return `${head}${child.title.replace(UNESCAPED_UNDERSCORE_RE, "\\_")}${close}`;
10113
10200
  }
10114
10201
  var CONTAINER_OPEN_RE = /^[ \t]*<(callout|details|columns|column)\b[^>]*>[ \t]*$/;
10115
10202
  var CONTAINER_CLOSE_RE = /^[ \t]*<\/(?:callout|details|columns|column)>[ \t]*$/;
@@ -10673,10 +10760,9 @@ function markersToMentions(obsidian) {
10673
10760
  // src/converter/table.ts
10674
10761
  var PIPE_TABLE_ATTRS = [["header-row", "true"]];
10675
10762
  var ESCAPED_PIPE = "\\|";
10676
- var CELL_PIPE_SOURCE = String.raw`(?<=(?:^|[^\\])(?:\\\\)*)\|`;
10677
- var CELL_PIPE_RE = new RegExp(CELL_PIPE_SOURCE);
10678
- var CELL_PIPES_RE = new RegExp(CELL_PIPE_SOURCE, "g");
10679
- var TRAILING_CELL_PIPE_RE = new RegExp(`${CELL_PIPE_SOURCE}$`);
10763
+ var CELL_PIPE_RE = new LookbehindRegExp(/\|/, void 0, evenBackslashesBefore);
10764
+ var CELL_PIPES_RE = new LookbehindRegExp(/\|/g, void 0, evenBackslashesBefore);
10765
+ var TRAILING_CELL_PIPE_RE = new LookbehindRegExp(/\|$/, void 0, evenBackslashesBefore);
10680
10766
  var CODE_PIPE_RE = /(\\*)\|/g;
10681
10767
  function encodeCodePipes(code) {
10682
10768
  return code.replace(CODE_PIPE_RE, (_m, bs) => `${bs}${bs}${ESCAPED_PIPE}`);
@@ -11364,6 +11450,7 @@ function mergeAndSplit(items) {
11364
11450
  }
11365
11451
 
11366
11452
  // src/converter/nfm-to-blocks.ts
11453
+ var UNESCAPED_PIPE_RE = new LookbehindRegExp(/\|/, void 0, notAfter(/\\/));
11367
11454
  function nfmToBlocks(nfm, options = {}) {
11368
11455
  const lines = nfm.split("\n");
11369
11456
  return prune(new NfmBlockParser(lines, options).parse(0, lines.length).map((p) => p.block));
@@ -11734,8 +11821,8 @@ function tableBlock(rows, header) {
11734
11821
  });
11735
11822
  }
11736
11823
  function pipeCells(line) {
11737
- const body = line.trim().replace(/^\|/, "").replace(/(?<!\\)\|$/, "");
11738
- return body.split(/(?<!\\)\|/).map((cell) => nfmInlineToRichText(cell.trim()));
11824
+ const body = line.trim().replace(/^\|/, "").replace(new LookbehindRegExp(/\|$/, void 0, notAfter(/\\/)), "");
11825
+ return body.split(UNESCAPED_PIPE_RE).map((cell) => nfmInlineToRichText(cell.trim()));
11739
11826
  }
11740
11827
  function emptyParagraph() {
11741
11828
  return { type: "paragraph", paragraph: { rich_text: [] } };
@@ -11973,7 +12060,12 @@ function obsidianToNotionEnhanced(obsidian) {
11973
12060
  result = sendLiteralBackslashes(result);
11974
12061
  return result;
11975
12062
  }
11976
- var ITALIC_WITH_ESCAPED_STAR_RE = /(?<![\\*\p{L}\p{N}])\*(?![\s*])((?:[^*_\n\\]|\\[^\n])*?\\\*(?:[^*_\n\\]|\\[^\n])*?)(?<![\s\\])\*(?![*\p{L}\p{N}])/gu;
12063
+ var ITALIC_WITH_ESCAPED_STAR_RE = new LookbehindRegExp(
12064
+ // 닫는 `*` 앞 글자가 공백 · `\\` 가 아니다 — 예전 `(?<![\s\\])` 를 마지막 조각(`[^…\s]` · `\\[^…\s\\]`)으로
12065
+ /\*(?![\s*])((?:[^*_\n\\]|\\[^\n])*?\\\*(?:(?:[^*_\n\\]|\\[^\n])*?(?:[^*_\n\\\s]|\\[^\n\s\\]))??)\*(?![*\p{L}\p{N}])/gu,
12066
+ void 0,
12067
+ notAfter(/[\\*\p{L}\p{N}]/u)
12068
+ );
11977
12069
  function underscoreItalicsWithStar(content) {
11978
12070
  if (!content.includes("\\*")) return content;
11979
12071
  return mapOutsideCode(
@@ -16541,6 +16633,11 @@ ${text}
16541
16633
  }
16542
16634
 
16543
16635
  // src/sync/database-creator.ts
16636
+ var PROP_REFERENCE_RE = new LookbehindRegExp(
16637
+ /prop\("([^"]+)"\)/g,
16638
+ void 0,
16639
+ notAfterText("current.")
16640
+ );
16544
16641
  function isSidecarPath(path) {
16545
16642
  return path.toLowerCase().endsWith(SIDECAR_SUFFIX);
16546
16643
  }
@@ -17102,7 +17199,7 @@ function messageOf3(error) {
17102
17199
  function dependentHint(dependent, schema, message) {
17103
17200
  const expression = dependent.body.formula?.expression;
17104
17201
  if (typeof expression === "string") {
17105
- const referenced = [...expression.matchAll(/(?<!current\.)prop\("([^"]+)"\)/g)].map((m) => m[1]).filter((name) => name !== dependent.name);
17202
+ const referenced = [...expression.matchAll(PROP_REFERENCE_RE)].map((m) => m[1]).filter((name) => name !== dependent.name);
17106
17203
  const blocked = referenced.filter(schema.stillMissing);
17107
17204
  if (blocked.length > 0) {
17108
17205
  return ` \u2014 \uAC00\uB9AC\uD0A4\uB294 \uC18D\uC131(${[...new Set(blocked)].join(", ")})\uC744 \uB9CC\uB4E4\uC9C0 \uBABB\uD574\uC11C\uB2E4`;
@@ -31419,7 +31516,7 @@ function inlineCodeRanges2(line) {
31419
31516
  const open = /`+/g;
31420
31517
  let start;
31421
31518
  while ((start = open.exec(line)) !== null) {
31422
- const close = new RegExp(`(?<!\`)${"`".repeat(start[0].length)}(?!\`)`, "g");
31519
+ const close = new LookbehindRegExp(`${"`".repeat(start[0].length)}(?!\`)`, "g", notAfter(/`/));
31423
31520
  close.lastIndex = start.index + start[0].length;
31424
31521
  const end = close.exec(line);
31425
31522
  if (end === null) continue;
@@ -31603,6 +31700,6 @@ function formatRatio(ratio) {
31603
31700
  return String(Math.round(ratio * 100) / 100);
31604
31701
  }
31605
31702
 
31606
- export { BaseFileGenerator, BlankLineCollapser, CONFIG_FILE, CONFLICT_STRATEGIES, CalloutRestorer, CalloutTransformer, ChangeDetector, ColorAnnotator, ConfigManager, ConfigSchema, ConflictResolver, ConnectionBoundaryError, ConnectionScopeError, ConversionPipeline, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, DatabaseSyncer, EmbedResolver, EntryEditor, FileHandler, FileWatcher, FilteredVaultFS, FrontmatterExtractor, FrontmatterGenerator, GITIGNORE_ENTRY, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, ImageHandler, InlineAnnotationPreserver, InlineDBParser, LocalImageRestorer, MARKER_BRAND, MathNormalizer, MentionToWikilink, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, NodeVaultFS, NotionBlockBuilder, NotionClient2 as NotionClient, OBSIDIAN_CONFIG_DIR, OBSIDIAN_ONLY_PATTERNS, PathFilter, PendingWalError, PreserveMarkerCollector, PreserveMarkerInjector, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, RENDER_LINE_RULES, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, SIDECAR_SUFFIX, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, ScopedVaultFS, SidecarGenerator, StateDB, StateDbLockedError, StateDbUnavailableError, StateLock, SyncBusyError, SyncOrchestrator, TEMPLATE_FOLDER_SETTINGS, TreeMapper, UnlinkedVaultError, UnsupportedBlockStripper, ViewDataProvider, WIKILINK_LOOKUPS, WatchSyncService, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, checkNotionAccess, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, findNestedFolderPages, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isHeadingLine, isHeadingMarkerLine, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, noteNameFromPath, notionIdFromInput, notionIdsEqual, notionPageUrl, obsidianOnlyExcludes, operationLabel, parseDesignColor, parseIgnorePatterns, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, sectionLinesWithHeadingMarkers, setLogger, shortNotionId, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, templateFolders, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };
31703
+ export { BaseFileGenerator, BlankLineCollapser, CONFIG_FILE, CONFLICT_STRATEGIES, CalloutRestorer, CalloutTransformer, ChangeDetector, ColorAnnotator, ConfigManager, ConfigSchema, ConflictResolver, ConnectionBoundaryError, ConnectionScopeError, ConversionPipeline, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, DatabaseSyncer, EmbedResolver, EntryEditor, FileHandler, FileWatcher, FilteredVaultFS, FrontmatterExtractor, FrontmatterGenerator, GITIGNORE_ENTRY, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, ImageHandler, InlineAnnotationPreserver, InlineDBParser, LocalImageRestorer, LookbehindRegExp, MARKER_BRAND, MathNormalizer, MentionToWikilink, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, NodeVaultFS, NotionBlockBuilder, NotionClient2 as NotionClient, OBSIDIAN_CONFIG_DIR, OBSIDIAN_ONLY_PATTERNS, PathFilter, PendingWalError, PreserveMarkerCollector, PreserveMarkerInjector, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, RENDER_LINE_RULES, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, SIDECAR_SUFFIX, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, ScopedVaultFS, SidecarGenerator, StateDB, StateDbLockedError, StateDbUnavailableError, StateLock, SyncBusyError, SyncOrchestrator, TEMPLATE_FOLDER_SETTINGS, TreeMapper, UnlinkedVaultError, UnsupportedBlockStripper, ViewDataProvider, WIKILINK_LOOKUPS, WatchSyncService, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, charBefore, checkNotionAccess, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, findNestedFolderPages, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isHeadingLine, isHeadingMarkerLine, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, notAfter, noteNameFromPath, notionIdFromInput, notionIdsEqual, notionPageUrl, obsidianOnlyExcludes, operationLabel, parseDesignColor, parseIgnorePatterns, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, sectionLinesWithHeadingMarkers, setLogger, shortNotionId, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, templateFolders, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };
31607
31704
  //# sourceMappingURL=index.js.map
31608
31705
  //# sourceMappingURL=index.js.map