Skip to content

Commit

Permalink
Minor tweak to commit 6ab67ef
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Aug 2, 2019
1 parent 7470d28 commit 470a708
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -1996,11 +1996,7 @@ and rewrite link paths to make blogging more seamless."
(format "[%s](%s)" desc path)
(format "<%s>" path))))
(`headline ;Links of type [[* Some heading]]
(let ((title (org-export-data-with-backend
(org-element-property :title destination) 'md info)))
;; (message "[ox-hugo-link DBG] headline title pre sanitize: %s"
;; (org-export-data (org-element-property :title destination) info))
;; (message "[ox-hugo-link DBG] headline title post sanitize: %s" title)
(let ((title (org-export-data (org-element-property :title destination) info)))
(format
"[%s](#%s)"
;; Description
Expand Down
6 changes: 3 additions & 3 deletions test/site/content-org/all-posts.org
Original file line number Diff line number Diff line change
Expand Up @@ -2907,17 +2907,17 @@ Once that is evaluated, links like these will export fine i.e. no
- Link (with description) to a heading with section number: [[* Beta 102][Link to
/Beta 102/ heading]]
- Link (no description) to a heading without section number: [[* Zeta 103
which has *some markup*]].
which has *some* /markup/]].

The space after that =*= in the link is optional.. so this also
works: [[*Zeta 103 which has *some markup*]].
works: [[*Zeta 103 which has *some* /markup/]].
**** Beta 102
- Link (with description) to a heading without section number: [[* Alpha 101][Link to
/Alpha 101/ heading]]
***** Gamma 102.1
****** Delta 102.1.1
****** Epsilon 102.1.2
**** Zeta 103 which has *some markup*
**** Zeta 103 which has *some* /markup/
:PROPERTIES:
:UNNUMBERED: t
:END:
Expand Down
8 changes: 4 additions & 4 deletions test/site/content/posts/link-to-headings-by-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ draft = false
- <span class="section-num">1.1</span> [Gamma 102.1](#gamma-102-dot-1)
- <span class="section-num">1.1.1</span> [Delta 102.1.1](#delta-102-dot-1-dot-1)
- <span class="section-num">1.1.2</span> [Epsilon 102.1.2](#epsilon-102-dot-1-dot-2)
- [Zeta 103 which has **some markup**](#zeta-103-which-has-some-markup)
- [Zeta 103 which has **some** _markup_](#zeta-103-which-has-some-markup)
- [Links (no descriptions) to headings with section numbers](#links--no-descriptions--to-headings-with-section-numbers)

</div>
Expand All @@ -30,10 +30,10 @@ draft = false

- Link (with description) to a heading with section number: [Link to
_Beta 102_ heading](#beta-102)
- Link (no description) to a heading without section number: [Zeta 103 which has **some markup**](#zeta-103-which-has-some-markup).
- Link (no description) to a heading without section number: [Zeta 103 which has **some** _markup_](#zeta-103-which-has-some-markup).

The space after that `*` in the link is optional.. so this also
works: [Zeta 103 which has **some markup**](#zeta-103-which-has-some-markup).
works: [Zeta 103 which has **some** _markup_](#zeta-103-which-has-some-markup).


## <span class="section-num">1</span> Beta 102 {#beta-102}
Expand All @@ -51,7 +51,7 @@ draft = false
#### <span class="section-num">1.1.2</span> Epsilon 102.1.2 {#epsilon-102-dot-1-dot-2}


## Zeta 103 which has **some markup** {#zeta-103-which-has-some-markup}
## Zeta 103 which has **some** _markup_ {#zeta-103-which-has-some-markup}


### Links (no descriptions) to headings with section numbers {#links--no-descriptions--to-headings-with-section-numbers}
Expand Down

0 comments on commit 470a708

Please sign in to comment.