Files
SuperCharged-Claude-Code-Up…/.venv/lib/python3.11/site-packages/markdown_it/rules_inline/text.py
uroma 55aafbae9a Fix project isolation: Make loadChatHistory respect active project sessions
- Modified loadChatHistory() to check for active project before fetching all sessions
- When active project exists, use project.sessions instead of fetching from API
- Added detailed console logging to debug session filtering
- This prevents ALL sessions from appearing in every project's sidebar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 14:43:05 +00:00

63 lines
1.1 KiB
Python

import functools
import re
# Skip text characters for text token, place those to pending buffer
# and increment current pos
from .state_inline import StateInline
# Rule to skip pure text
# '{}$%@~+=:' reserved for extensions
# !!!! Don't confuse with "Markdown ASCII Punctuation" chars
# http://spec.commonmark.org/0.15/#ascii-punctuation-character
_TerminatorChars = {
"\n",
"!",
"#",
"$",
"%",
"&",
"*",
"+",
"-",
":",
"<",
"=",
">",
"@",
"[",
"\\",
"]",
"^",
"_",
"`",
"{",
"}",
"~",
}
@functools.cache
def _terminator_char_regex() -> re.Pattern[str]:
return re.compile("[" + re.escape("".join(_TerminatorChars)) + "]")
def text(state: StateInline, silent: bool) -> bool:
pos = state.pos
posMax = state.posMax
terminator_char = _terminator_char_regex().search(state.src, pos)
pos = terminator_char.start() if terminator_char else posMax
if pos == state.pos:
return False
if not silent:
state.pending += state.src[state.pos : pos]
state.pos = pos
return True