Ranchero-Software / NetNewsWire

RSS reader for macOS and iOS.
https://netnewswire.com/
MIT License
8.45k stars 535 forks source link

Bug: Footnote detection not working in some circumstances #3564

Closed Alex-Vasile closed 2 years ago

Alex-Vasile commented 2 years ago

Currently hyperlink footnotes (which link to the bottom of the article) show up properly in the view of the article inside the app.

However, clicking on any of them opens a webpage.

Instead, it would be great if the link was recognized as a footnote and took me to it within the app, rather than kick me to the website.

brentsimmons commented 2 years ago

Normally these work properly. What’s the URL of the feed?

Alex-Vasile commented 2 years ago

Normally these work properly. What’s the URL of the feed?

https://theconvivialsociety.substack.com/feed/

This article for example has the issue: https://theconvivialsociety.substack.com/p/the-uncanny-gaze-of-the-machine

But I've had issues with others too. This is just the most recent.

brentsimmons commented 2 years ago

It’s evading our footnote detection code, for some reason. A bug.

Krinkle commented 2 years ago

I'm struggling to get the footnotes to work in NetNewsWire 6.1 on macOS or iOS.

I've switched, forked, modified or hand coded footnote markup on my blog multiple times to try and get it to work, but to no avail. I currently use Jekyll with the built-in footnotes from Kramdown.

Article: https://timotijhof.net/posts/2022/internet-archive-crawling/ HTML:

<sup id="fnref:sse" role="doc-noteref">
  <a href="#fn:sse" class="footnote" rel="footnote" title="Jump to footnote 1">[1]</a>
</sup>
…
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:sse" role="doc-endnote"><p>
        The technology was around as early as 2006, …
        <a href="#fnref:sse" class="reversefootnote" role="doc-backlink" title="Jump back">↩︎</a>
    </p></li>

Neither the jump to nor the jump back seems to work (it opens in the browser instead).

I'm actually quite excited by this comments on this and other issues, as they suggests it's not so much a feature request, but a bug report. It's just that I've never actually seen the in-app jump work on any blogs I follow.

Five additional examples when looking for footnotes in starred articles in NetNewsWire – not one of which seems to work.

Article: https://danluu.com/everything-is-broken/ https://danluu.com/cpu-backdoors/ HTML:

<sup class="footnote-ref" id="fnref:R"><a rel="footnote" href="#fn:R">1</a></sup> 
…
<div class="footnotes">
  <ol>
    <li id="fn:R">If you …. <a class="footnote-return" href="#fnref:R"><sup>[return]</sup></a></li> 

Article: https://daverupert.com/2022/04/server-side-vs-client-side-analytics/ HTML:

<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup>
…
<section class="footnotes">
 <ol>
  <li id="fn1"><p>Maybe … <a href="#fnref1" class="footnote-backref">↩</a></p> </li>

Article: https://mango.pdf.zone/i-give-you-feedback-on-your-blog-post-draft-but-you-dont-send-it-to-me HTML:

<sup id="fnref:onesentence" role="doc-noteref"><a href="#fn:onesentence" class="footnote" rel="footnote">1</a></sup>
…
<div class="footnotes" role="doc-endnotes">
 <ol>
  <li id="fn:onesentence" role="doc-endnote"> …<a href="#fnref:onesentence" class="reversefootnote" role="doc-backlink">&#8617;</a></li>

Article: https://blog.mollywhite.net/predatory-community/ HTML:

 <sup id="fnref:fn1"><a href="#fn:fn1" class="footnote">1</a></sup>
…
<div class="footnotes">
 <ol>
 <li id="fn:fn1"> …<a href="#fnref:fn1" class="reversefootnote">&#x21a9;&#xfe0e;</a>

Artice: https://daringfireball.net/2022/06/require_a_passcode_to_unlock_your_iphone HTML:

<sup id="fnr1-2022-06-27"><a href="#fn1-2022-06-27">1</a></sup>
…
<div class="footnotes">
 <ol>
 <li id="fn1-2022-06-27">
    … <a href="#fnr1-2022-06-27" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">&#x21A9;&#xFE0E;</a>
 </li>

With giants like DF not working, I'm suspecting that I've probably done something stupid and broke it just for me, on both macOS and iOS.. somehow. Feel free to suggest a PEBKAC diagnosis 🙂 .

vincode-io commented 2 years ago

@Krinkle You blog does work with footnotes if you are using the Local of iCloud accounts. Are you maybe using Feedly? They strip footnote information that we need to make them work properly.

Krinkle commented 2 years ago

@vincode-io I use self-hosted FreshRSS. It does not appear to strip the footnotes section. The footnotes are all there visually in NetNewsWire for the above blogs. But, both the inline [1] links and the "Back" links lead to a browser window with the online web page instead of navigating up and down within the article as rendered in NetNewsWire.

vincode-io commented 2 years ago

Can you check the difference between the HTML for the FreshRSS and On My Mac accounts to see what is different?

Krinkle commented 2 years ago

Okay, so via "On My Mac" it works quite lovely. First time I see that. Even as an inline pop-over. Very nice! 🙂

Screenshot 2022-07-12 at 10 13 37

With my skeptical hat on, I suppose that means either FreshRSS is breaking the content in some way, or a bug or conditional in the NNW rendering logic that varies by feed source or account type. The latter seems unlikely, but I don't know the code base.

I'm not sure how to see the HTML as received by NNW. But the below might approximate it. I found one of the FreshRSS APIs, and could access the same feed through its proxy. I don't think that's how NNW actually reads it though, but I'm not sure how to get a specific article through the greader API.

<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Timo Tijhof | FreshRSS</title>
        ###
        <atom:link href="###/i/?a=rss&amp;get=f_103&amp;rid=###" rel="self" type="application/rss+xml" />
        <item>
            <title>How does Internet Archive know?</title>
            <link>https://timotijhof.net/posts/2022/internet-archive-crawling/</link>
            ###
            <description><![CDATA[<p>The Internet Archive discovers in real-time when WordPress blogs publish a new post, and when Wikipedia articles reference new sources. How does that work?</p>
###
<p>###.<sup role="doc-noteref"><a href="https://timotijhof.net/posts/2022/internet-archive-crawling/#fn:sse" rel="footnote">1</a></sup> This makes <a href="https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams/Powered_By">cool demos</a> possible, getting started with only the following JavaScript:</p>
###
<div role="doc-endnotes">
  <ol>
    <li role="doc-endnote"><p>The “Server-sent events” technology was around as early as 2006, originating at Opera (<a href="https://dev.opera.com/blog/event-streaming-to-web-browsers/">announcement</a>, <a href="https://en.wikipedia.org/wiki/Server-sent_events#History">history</a>). It was among the first specifications to be drafted through WHATWG, which formed in 2004 after <a href="https://en.wikipedia.org/wiki/WHATWG#History">the W3C XHTML debacle</a>. <a href="https://timotijhof.net/posts/2022/internet-archive-crawling/#fnref:sse" role="doc-backlink">↩</a></p> </li>
    ###
]]></description>
            <pubDate>Mon, 20 Jun 2022 21:30:00 +0200</pubDate>
            <guid isPermaLink="false">1655754631585447</guid>
        </item>

Compared to the original:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <generator>Jekyll</generator>
    <link href="https://timotijhof.net/feed.xml" rel="self" type="application/atom+xml" />
    ###
    <entry>
        <title type="html">How does Internet Archive know?</title>
        <link href="https://timotijhof.net/posts/2022/internet-archive-crawling/" rel="alternate" type="text/html" title="How does Internet Archive know?" />
        <published>2022-06-20T20:30:00+01:00</published>
        <updated>2022-06-20T20:30:00+01:00</updated>
        <id>https://timotijhof.net/posts/2022/internet-archive-crawling</id>
        ###
        <content type="html" xml:base="https://timotijhof.net/posts/2022/internet-archive-crawling/">&lt;p&gt;The Internet Archive discovers in real-time when WordPress blogs publish a new post, and when Wikipedia articles reference new sources. How does that work?&lt;/p&gt;
###
&lt;p&gt;###&lt;sup id=&quot;fnref:sse&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:sse&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; This makes &lt;a href=&quot;https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams/Powered_By&quot;&gt;cool demos&lt;/a&gt; possible, getting started with only the following JavaScript:&lt;/p&gt;
###
&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:sse&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;The “Server-sent events” technology was around as early as 2006, originating at Opera (&lt;a href=&quot;https://dev.opera.com/blog/event-streaming-to-web-browsers/&quot;&gt;announcement&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Server-sent_events#History&quot;&gt;history&lt;/a&gt;). It was among the first specifications to be drafted through WHATWG, which formed in 2004 after &lt;a href=&quot;https://en.wikipedia.org/wiki/WHATWG#History&quot;&gt;the W3C XHTML debacle&lt;/a&gt;. &lt;a href=&quot;#fnref:sse&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    ###</content>

It's in a different format, but content-wise appears to be unmodified. Perhaps there is some bad metadata in here from FreshRSS that is somehow significantly altering the way that (same) content is interpreted by NNW?

vincode-io commented 2 years ago

@Krinkle Do you have a publicly accessible FressRSS instance? If so and you could provide me with a user account, I'll take a look at what is happening with the FreshRSS HTML. You can send credentials to mo@vincode.io.

Otherwise I'll have to spin up a FreshRSS instance and it might be some time before I can do so.

Krinkle commented 2 years ago

@Krinkle Do you have a publicly accessible FressRSS instance? […] You can send credentials to mo@vincode.io.

Done.

vincode-io commented 2 years ago

It looks like FreshRSS converts the footnote anchor into a fully resolved link. I've asked on the FreshRSS site if this is intentional.

https://github.com/FreshRSS/FreshRSS/discussions/4476

vincode-io commented 2 years ago

FreshRSS is tracking this issue as https://github.com/FreshRSS/FreshRSS/issues/4481.