put filename back outside fences

This commit is contained in:
Paul Gauthier 2024-05-01 11:56:29 -07:00
parent e76d1c0cfa
commit f4b1797998
2 changed files with 11 additions and 7 deletions

View file

@ -329,7 +329,11 @@ def strip_filename(filename, fence):
return return
filename = filename.rstrip(":") filename = filename.rstrip(":")
filename = filename.lstrip("#")
filename = filename.strip()
filename = filename.strip("`") filename = filename.strip("`")
filename = filename.strip("*")
filename = filename.replace("\\_", "_")
return filename return filename

View file

@ -34,8 +34,8 @@ All changes to files must use the *SEARCH/REPLACE block* format.
Here are the *SEARCH/REPLACE* blocks: Here are the *SEARCH/REPLACE* blocks:
{fence[0]}
mathweb/flask/app.py mathweb/flask/app.py
{fence[0]}python
<<<<<<< SEARCH <<<<<<< SEARCH
from flask import Flask from flask import Flask
======= =======
@ -44,8 +44,8 @@ from flask import Flask
>>>>>>> REPLACE >>>>>>> REPLACE
{fence[1]} {fence[1]}
{fence[0]}
mathweb/flask/app.py mathweb/flask/app.py
{fence[0]}python
<<<<<<< SEARCH <<<<<<< SEARCH
def factorial(n): def factorial(n):
"compute factorial" "compute factorial"
@ -59,8 +59,8 @@ def factorial(n):
>>>>>>> REPLACE >>>>>>> REPLACE
{fence[1]} {fence[1]}
{fence[0]}
mathweb/flask/app.py mathweb/flask/app.py
{fence[0]}python
<<<<<<< SEARCH <<<<<<< SEARCH
return str(factorial(n)) return str(factorial(n))
======= =======
@ -83,8 +83,8 @@ mathweb/flask/app.py
Here are the *SEARCH/REPLACE* blocks: Here are the *SEARCH/REPLACE* blocks:
{fence[0]}
hello.py hello.py
{fence[0]}python
<<<<<<< SEARCH <<<<<<< SEARCH
======= =======
def hello(): def hello():
@ -94,8 +94,8 @@ def hello():
>>>>>>> REPLACE >>>>>>> REPLACE
{fence[1]} {fence[1]}
{fence[0]}
main.py main.py
{fence[0]}python
<<<<<<< SEARCH <<<<<<< SEARCH
def hello(): def hello():
"print a greeting" "print a greeting"
@ -110,8 +110,8 @@ from hello import hello
] ]
system_reminder = """Every *SEARCH/REPLACE block* must use this format: system_reminder = """Every *SEARCH/REPLACE block* must use this format:
1. The opening fence and code language, eg: {fence[0]} 1. The file path alone on a line, verbatim. No bold asterisks, no quotes around it, no escaping of characters, etc.
2. The file path alone on a line, eg: main.py 2. The opening fence and code language, eg: {fence[0]}python
3. The start of search block: <<<<<<< SEARCH 3. The start of search block: <<<<<<< SEARCH
4. A contiguous chunk of lines to search for in the existing source code 4. A contiguous chunk of lines to search for in the existing source code
5. The dividing line: ======= 5. The dividing line: =======