Skip to content

Commit

Permalink
Fix escaping of special characters on index page
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Mar 18, 2024
1 parent 0fb180c commit fd89012
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion gen_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def write_index_page(index):
letter = start
f.write(f"\n## {start.upper()}\n")

f.write(f"**{name}**:\n\n")
escaped_name = name.replace("\\", "\\\\").replace("*", "\\*")
f.write(f"**{escaped_name}**:\n\n")
for link, entry in sorted(links):
f.write(f" - [{entry}]({link})\n")
f.write("\n\n")
Expand Down
10 changes: 5 additions & 5 deletions src/functions-reference/functions_index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ pagetitle: Alphabetical Index
- [`(row_vector x) : vector`](matrix_operations.qmd#index-entry-e3432686a771bad98175ab4a594d8156ab915492)


**operator***:
**operator\***:

- [`(complex x, complex y) : complex`](complex-valued_basic_functions.qmd#index-entry-e3a6425a4fd372a6a28b66eb58c06245046f87ae)
- [`(complex_vector x, complex y) : complex_vector`](complex_matrix_operations.qmd#index-entry-23a93f16e6035cc32b84ecf97c32845e9008702c)
Expand Down Expand Up @@ -2493,7 +2493,7 @@ pagetitle: Alphabetical Index
- [`(real x, real y) : real`](real-valued_basic_functions.qmd#index-entry-08f55cee893fdef254457be66b7a82c1d942ad0e)


**operator*=**:
**operator\*=**:

- [`(complex x, complex y) : void`](complex-valued_basic_functions.qmd#index-entry-0c45a357fc47d9ccf6a7fb7780ee7d1ada6cc2bd)
- [`(T x, U y) : void`](compound_arithmetic_and_assignment.qmd#index-entry-518f24c806ec47af7c7aa48506a1cd57ef3676df)
Expand Down Expand Up @@ -2578,7 +2578,7 @@ pagetitle: Alphabetical Index
- [`(T x, U y) : void`](compound_arithmetic_and_assignment.qmd#index-entry-e3beea1794e1e8704ae6177a2392b78fccebd4d4)


**operator.***:
**operator.\***:

- [`(complex_row_vector x, complex_row_vector y) : complex_row_vector`](complex_matrix_operations.qmd#index-entry-8225aa3a59b24f94b5efa4533b49050ef65e64ca)
- [`(complex_matrix x, complex_matrix y) : complex_matrix`](complex_matrix_operations.qmd#index-entry-8eb7c34b5da648cda9b6f992d4218d023c05d1da)
Expand All @@ -2588,7 +2588,7 @@ pagetitle: Alphabetical Index
- [`(vector x, vector y) : vector`](matrix_operations.qmd#index-entry-f6b9c926ae8c20a429454fbfd788a05c447ca21f)


**operator.*=**:
**operator.\*=**:

- [`(T x, U y) : void`](compound_arithmetic_and_assignment.qmd#index-entry-549243a6af6a91c078444182753a8e8f435862e3)

Expand Down Expand Up @@ -2701,7 +2701,7 @@ pagetitle: Alphabetical Index
- [`(int x, int y) : int`](real-valued_basic_functions.qmd#index-entry-9d2656ef1df47087d225d2cfd011938c49677d09)


**operator\**:
**operator\\**:

- [`(matrix A, matrix B) : matrix`](matrix_operations.qmd#index-entry-1a08f375cfc4067e97bfed98fae8490e8b6f0698)
- [`(matrix A, vector b) : vector`](matrix_operations.qmd#index-entry-fc754907294117fa562e6fcaf1b8afcf0d2efabd)
Expand Down
2 changes: 1 addition & 1 deletion src/html-index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- to create a clickable index of all the functions in the documentation

function extractIndexEntry(elementText)
if elementText:find(";-->$") ~= nil then
if elementText:find("%; %-%-%>$") ~= nil then
return "index-entry-" .. tostring(pandoc.sha1(elementText))
end
return nil
Expand Down

0 comments on commit fd89012

Please sign in to comment.