Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchia committed Sep 19, 2024
1 parent 6e79d8b commit e9c394b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/jupyter-ai/jupyter_ai/context_providers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def _replace_instance(self, instance: str) -> str:


def _is_within_backticks(match, text):
# potentially buggy if there is a stray backtick in text
# e.g. "help me count the backticks '`' in @file:file.txt".
# better addressed by having a better instance detection mechanism
# such as placing commands with special tags.
start, _ = match.span()
before = text[:start]
return before.count("`") % 2 == 1
Expand Down

0 comments on commit e9c394b

Please sign in to comment.