Skip to content

Commit

Permalink
Merge pull request #4289 from szarnyasg/nits-20241207a
Browse files Browse the repository at this point in the history
Single-file generator script: Make regex non-greedy
  • Loading branch information
szarnyasg authored Dec 7, 2024
2 parents 5c00a30 + a7135a8 commit 5cb477d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions single-file-document/concatenate_to_single_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ def adjust_links_in_doc_body(doc_body):
# replace links to data sets to point to the website
doc_body = doc_body.replace("](/data/", "](https://duckdb.org/data/")

# replace '<img>' HTML tags with Markdown's '![]()' construct
doc_body = re.sub(r'<img src="([^"]*)"[^§]*?/>', r'![](\1)', doc_body, flags=re.MULTILINE)

# use relative path for images in Markdown
doc_body = doc_body.replace("](/images", "](../images")
# replace <img> tags with Markdown
doc_body = doc_body.replace('"/images', '"../images')
doc_body = re.sub(r'<img src="([^"]*)"[^§]*/>', r'![](\1)', doc_body, flags=re.MULTILINE)

# express HUGEINT limits as powers of two (upper and lower limits are ±2^127-1)
doc_body = doc_body.replace("-170141183460469231731687303715884105727", "$-2^{127}-1$")
Expand Down

0 comments on commit 5cb477d

Please sign in to comment.