Skip to content

Commit

Permalink
Use better regex for prepending ID to CSS rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-iannone committed Dec 6, 2023
1 parent a94a464 commit f3acbe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion great_tables/gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def _compile_scss(data: GT, id: Optional[str]) -> str:
if has_id:
compiled_css = re.sub(r"\.gt_", f"#{id} .gt_", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r"thead", f"#{id} thead", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r" p \{", f"#{id} p " + "{", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r"^p \{", f"#{id} p " + "{", compiled_css, 0, re.MULTILINE)

finalized_css = f"{gt_table_class_str}\n\n{compiled_css}"

Expand Down

0 comments on commit f3acbe5

Please sign in to comment.