-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite org-hugo--sanitize-title; make it more robust
The org-hugo--sanitize-title function is re-written, now with added test cases for even apparently pathological cases. Now it is possible to have *, _ and ` characters in the post title.
- Loading branch information
1 parent
3b6a046
commit dffb7e9
Showing
8 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
+++ | ||
title = "ndash and mdash" | ||
title = "ndash `and` mdash" | ||
date = 2017-07-22 | ||
tags = ["body"] | ||
draft = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
+++ | ||
title = "Title with *lots and lots of * aste*risks**" | ||
tags = ["title"] | ||
draft = false | ||
+++ | ||
|
||
- All asterisk characters meant for Org `*bold*` markup are removed. | ||
- The rest of the asterisk characters are retained. |
8 changes: 8 additions & 0 deletions
8
test/site/content/posts/title_with_asterisks_underscores_backticks.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
+++ | ||
title = "Title with lots of ` ` ` backticks` * asterisks bold, italics retain*,_,` in monospace underscores _ _ foo bar **" | ||
tags = ["title"] | ||
draft = false | ||
+++ | ||
|
||
- All the Org markup characters are removed. | ||
- The "markup characters" not doing actual markup are retained. |
9 changes: 9 additions & 0 deletions
9
test/site/content/posts/title_with_backticks_equals_tildes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Title with lots of ` ` ` backticks` `foo bar ~ zoomba" | ||
tags = ["title"] | ||
draft = false | ||
+++ | ||
|
||
- All equal/tilde characters meant for Org `~code~` or `=verbatim=` | ||
markup are removed. | ||
- The rest of the equal/tilde characters are retained. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Title with lots and lots / / / of forward/slashes" | ||
tags = ["title"] | ||
draft = false | ||
+++ | ||
|
||
- All forward slash characters meant for Org `/italic/` markup are | ||
removed. | ||
- The rest of the forward slash characters are retained. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Title with _lots and _lots _ _ of under_scores__" | ||
tags = ["title"] | ||
draft = false | ||
+++ | ||
|
||
- All underscore characters meant for Org `_underline_` markup are | ||
removed. | ||
- The rest of the underscore characters are retained. |