scripting / a8c-FeedLand-Support

A public repo for discussing FeedLand at A8C.
1 stars 0 forks source link

How Markdown flows through FeedLand #4

Open scripting opened 1 year ago

scripting commented 1 year ago

I have a fictitious user, Bull Mancuso, who uses FeedLand. His outgoing feed is here:

http://data.feedland.org/feeds/bull.xml

To start the exploration, I added a titled item with a single bit of styled text in it.

image

This is what the item looks like in the timeline.

image

And this is what it looks like in the feed.

<item>
      <title>First Markdown test</title>
      <description>I want to take a look at how Markdown is generated by FeedLand and how it displays it. This is where we start, with a post with a <strong>single bit</strong> of marked up text.</description>
      <pubDate>Thu, 17 Aug 2023 14:56:56 GMT</pubDate>
      <link>https://feedland.org/?item=5015542</link>
      <guid>https://feedland.org/?item=5015542</guid>
      <source:markdown>I want to take a look at how Markdown is generated by FeedLand and how it displays it. This is where we start, with a post with a **single bit** of marked up text.</source:markdown>
      </item>

This all looks exactly as I wanted it to. Next step I'm going to see how the rendering if the item takes place in feedlandHome. I want to see the actual code that's turning the Markdown text into HTML. Back in a bit..

scripting commented 1 year ago

I have good news and bad news.

First the bad news.

feedlandHome wasn't converting markdowntext if it was present, and using that in place of description.

Bad Dave! You f-cked up. :-)

Now the good news.

I added the code, and it works! :-)

Markdown is really easy to support.

image

scripting commented 1 year ago

Now we're ready for the next test.

I have access to an experimental blog @fmfernandes set up, and have posted something there and ran it through FeedLand. There is a problem. In the feed the *'s are escaped with backslashes. As far as I know that's not recognized as Markdown syntax. Net-net imho the backslashes should not be there.

Here's the data.

This is the post.

This is the feed item for the post:

<item>
   <title>This is Dave</title>
   <link>https://scriptingfeeds.wpcomstaging.com/2023/08/17/this-is-dave/</link>
   <comments>https://scriptingfeeds.wpcomstaging.com/2023/08/17/this-is-dave/#respond</comments>
   <dc:creator><![CDATA[scripting]]></dc:creator>
   <pubDate>Thu, 17 Aug 2023 19:54:14 +0000</pubDate>
   <category><![CDATA[Uncategorized]]></category>
   <guid isPermaLink="false">https://scriptingfeeds.wpcomstaging.com/?p=33</guid>
   <description><![CDATA[I am writing some text in this blog post that will ultimately be read by FeedLand. If it works there will be **Markdown** text, something which everyone will love no doubt.]]></description>
   <content:encoded><![CDATA[
<p>I am writing some text in this blog post that will ultimately be read by FeedLand. If it works there will be **Markdown** text, something which everyone will love no doubt.</p>
]]></content:encoded>
   <wfw:commentRss>https://scriptingfeeds.wpcomstaging.com/2023/08/17/this-is-dave/feed/</wfw:commentRss>
   <slash:comments>0</slash:comments>
   <source:markdown>I am writing some text in this blog post that will ultimately be read by FeedLand. If it works there will be \*\*Markdown\*\* text, something which everyone will love no doubt.</source:markdown>
   <post-id xmlns="com-wordpress:feed-additions:1">33</post-id>
   </item>

This is what it looks like in FeedLand.

image

My mistake. Back in a minute. ;-)

scripting commented 1 year ago

We're good. The WordPress feed has a good element. More testing tomorrow.

scripting commented 1 year ago

I'm creating new posts that test whether various features of Markdown are well-translated by the markdown encoder in code on the WP side and are properly decoded in FeedLand.

Change in FeedLand

I made one change before starting, when we do the Markdown substitution on rendering, I enclose the generated text in a div class="divMarkdownGeneratedText" for two reasons:

  1. So we can easily see when debugging that it was properly converted and

  2. In case there are any tweaks we want to do for specific Markdown codes, this makes it easy to do special cases.

Pointers

  1. The feed.
  2. The WordPress rendering.
  3. The FeedLand rendering of the same.

One thing I noticed is that FeedLand is not getting rssCloud notifications for this feed, and this is the feedland.org instance, so it has nothing to do with multiple instances or ports, or whatever is preventing the a8c install from getting notifications.

The new tests

These all worked as they should except where noted.

  1. Simple styling. Works.
  2. Links. Works.
  3. Headers (all the same size). Works.
  4. Different size headers. Works.
  5. Different block types. There are problems with this one. The lists don't show up with numbers or bullets, and the code is not doing well at all. But it could be because I didn't find all the formatting options for the lists and code in WP.
  6. Images. The images don't show up in FeedLand.
scripting commented 1 year ago

@fmfernandes -- i fixed the CSS issue for markdowntext, so the lists now work properly in FeedLand.