Skip to content

Commit

Permalink
Don't include code tags in Org headlines when creating slug
Browse files Browse the repository at this point in the history
Fixes #58
  • Loading branch information
kaushalmodi committed Aug 2, 2017
1 parent 280c199 commit 6d3376f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example-site/content-org/all-posts.org
Expand Up @@ -868,15 +868,15 @@ See [[http://orgmode.org/manual/Plain-lists.html][(org) Plain lists]] to read mo
:EXPORT_DATE: 2017-08-02
:END:
This is a check-list:
*** Checklist [40%]
*** Checklist 1 [60%]
Checklist showing progress in percentage.

- [ ] Task 1
- [ ] Task 2
- [X] Task 2
- [X] Task 3
- [ ] Task 4
- [X] Task 5
*** Checklist [2/5] :@fixme:
*** Checklist 2 [2/5] :@fixme:
Checklist showing progress in ratio.

- [ ] Task 1
Expand Down
6 changes: 3 additions & 3 deletions example-site/content/posts/checklist.md
Expand Up @@ -8,18 +8,18 @@ draft = false
This is a check-list:


## Checklist <code>[40%]</code> {#checklist-code-40-code}
## Checklist 1 <code>[60%]</code> {#checklist-1}

Checklist showing progress in percentage.

- [ ] Task 1
- [ ] Task 2
- [X] Task 2
- [X] Task 3
- [ ] Task 4
- [X] Task 5


## Checklist <code>[2/5]</code> {#checklist-code-2-5-code}
## Checklist 2 <code>[2/5]</code> {#checklist-2}

Checklist showing progress in ratio.

Expand Down
3 changes: 3 additions & 0 deletions ox-hugo.el
Expand Up @@ -320,6 +320,7 @@ returned slug string has the following specification:
- Should contain only lower case alphabet, number and hyphen
characters.
- Remove \"<code>..</code>\" part from STR if present.
- URLs if present in STR should be removed.
- Replace \".\" in STR with \"and\", and \"&\" with \"and\".
- Parentheses should be replaced with double-hyphens ( \"foo (bar)
Expand All @@ -331,6 +332,8 @@ returned slug string has the following specification:
returned string ."
(let* (;; All lower-case
(str (downcase str))
;; Remove "<code>..</code>" stuff if present
(str (replace-regexp-in-string "<code>.*</code>" "" str))
;; Remove URLs if present in the string
;; The ")" in the below regexp is the closing parenthesis of a
;; Markdown link: [Desc](Link)
Expand Down

0 comments on commit 6d3376f

Please sign in to comment.