public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* HTML anchor links to docx internal hyperlinks
@ 2018-01-12 22:31 Joel M
  0 siblings, 0 replies; only message in thread
From: Joel M @ 2018-01-12 22:31 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2698 bytes --]

 

I’m converting from HTML to docx using this URL as input: 
https://www.givewell.org/charities/helen-keller-international  
<https://www.givewell.org/charities/helen-keller-international>


Works fairly well out of the box but experiencing a puzzling behavior. The 
footnotes in the HTML go in both directions: clicking footnote reference 1 
goes to footnote 1 and vice versa. This is accomplished with “pairs” of <a>/
<li> tags like this:

 

*Footnote ref link:*

<a class="see-footnote" id="footnoteref1_uginwip" title="  We have 
published notes from one of our conversations with HKI staff: GiveWell's 
non-verbatim summary of a conversation with Helen Keller International, 
June 1, 2017.  " href="#footnote1_uginwip">1</a>

*Footnote link back to footnote ref:*
<li class="footnote" id="footnote1_uginwip"><a class="footnote-label" href=
"#footnoteref1_uginwip">1.</a> 

<p>We have published notes from one of our conversations with HKI staff: <a 
class="source-definition" href=
"http://files.givewell.org/files/conversations/Helen_Keller_International_06-01-17_(public).pdf"
>GiveWell's non-verbatim summary of a conversation with Helen Keller 
International, June 1, 2017</a>.</p> 

</li>


So each footnote ref links to an <li> while each footnote links back to an 
<a>

 

In the resulting .docx the footnotes only work in one direction: clicking 
footnote ref 1 goes to footnote 1 but clicking footnote 1 hyperlink goes to 
Top of Document.

 

Pandoc/Word creates bookmarks around each footnote number (not the entire 
<li>). The bookmark names are the same as the footnote <li> html IDs. 
Unfortunately, it does NOT create bookmarks around each of the footnote 
refs for the footnote to link back to.

 

It seems odd that it would recognize the ID of a <li> and link to it 
correctly, but it doesn’t recognize the ID of an <a> and link to it 
correctly. Maybe there’s some practical reason for this—does anyone know 
why? And/or how I might go about achieving the desire behavior of the 
footnote linking back to its reference <a>?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e6d465a5-1adc-453a-910e-635e4a0a21df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 47033 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-12 22:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 22:31 HTML anchor links to docx internal hyperlinks Joel M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).