Review of Leaflet's RSS feed
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
Hướng nghiên cứu
Start with the sample RSS feed at https://davew.leaflet.pub/rss and compare its item title, description, content:encoded, and guid elements with the RSS 2.0 requirements linked in the issue. Review the provided encodeXml JavaScript function and the feed-generation entry point it maps to. Done means the feed has portable descriptions, valid required metadata, and a correctly represented permalink GUID.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have been DM'ing with the developer of Leaflet and made sure he'd welcome this review, and he said yes.
I like their work so much I want it to be part of our ecosystem, and I want to be part of theirs. This is the web philosophy imho.
If there are questions or suggestions, please add a comment.
Here's a test feed
I ran the source through a linter, and pasted the result below. Easier to work with. ;-)
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Let’s try leaflet</title>
<link>https://davew.leaflet.pub</link>
<description>I want to have a try and hopefully some fun.</description>
<lastBuildDate>Thu, 30 Jul 2026 18:06:57 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>en</language>
<atom:link href="https://davew.leaflet.pub/rss" rel="self" type="application/rss+xml"/>
<item>
<link>https://davew.leaflet.pub/3mruzs43bys26</link>
<guid isPermaLink="false">https://davew.leaflet.pub/3mruzs43bys26</guid>
<pubDate>Thu, 30 Jul 2026 18:06:57 GMT</pubDate>
<content:encoded>
<![CDATA[<div class="postContent footnote-scope flex flex-col"><p style="font-size:1em"><span class=" ">this is a draft i would like to publish. no title, no optional description</span></p></div>]]>
</content:encoded>
</item>
<item>
<link>https://davew.leaflet.pub/3mruzom5rm223</link>
<guid isPermaLink="false">https://davew.leaflet.pub/3mruzom5rm223</guid>
<pubDate>Thu, 30 Jul 2026 18:05:00 GMT</pubDate>
<content:encoded>
<![CDATA[<div class="postContent footnote-scope flex flex-col"><p style="font-size:1em"><span class=" ">this is a post that has neither a title or description, but it does have a body, let's see how this shows up in RSS. </span></p></div>]]>
</content:encoded>
</item>
<item>
<title>
<![CDATA[This is a text]]>
</title>
<link>https://davew.leaflet.pub/3mrsmwug7j22f</link>
<guid isPermaLink="false">https://davew.leaflet.pub/3mrsmwug7j22f</guid>
<pubDate>Wed, 29 Jul 2026 19:11:39 GMT</pubDate>
<description>
<![CDATA[No sage advice here!]]>
</description>
<content:encoded>
<![CDATA[<div class="postContent footnote-scope flex flex-col"><p style="font-size:1em"><span class=" ">Bingo bongo bingo </span><span class=" italic ">sheesh</span><span class=" "> it rained a lot today.</span></p><p style="font-size:1em"><span class=" ">I was looking for its outgoing RSS feed which Claude assured me is here.</span></p><p style="font-size:1em"><span class=" "></span></p></div>]]>
</content:encoded>
</item>
</channel>
</rss>
The description element
The item-level <description> element is where the text of a post goes.
One of <title> and <description> is required. The first two posts have neither. content:encoded is not part of RSS, so it doesn't qualify.
Also use of <![CDATA is mysterious and not necessary if you properly encode a few characters in your description. I've pasted the source of the XML encoding function we use in FeedLand and other software, at the end of this post.
The HTML in descriptions is Leaflet's internal markup, not portable HTML. This is the biggest issue. It would be better to just strip the markup, because no one but Leaflet knows what to do with it. But it would be nice to pass through simple styling -- bold, italic, links, bulleted or numbered lists.
The guid element
<guid isPermaLink="false">https://davew.leaflet.pub/3mruzs43bys26</guid>
The contents of the guid appears to be a valid URL, so you can do this.
<guid>https://davew.leaflet.pub/3mruzs43bys26</guid>
It is a permalink, reader software should be encouraged to present it to the reader, and the default value of isPermaLink is true.
Seeing a guid that's not a permalink is pretty unusual.
The human-readable version of the XML
encodeXml function source
function encodeXml (s) { //7/15/14 by DW
Changes
12/14/15; 4:28:14 PM by DW
Check for undefined, return empty string.
if (s === undefined) {
return ("");
}
else {
var charMap = {
'<': '<',
'>': '>',
'&': '&',
'"': '&'+'quot;'
};
s = s.toString();
s = s.replace(/\u00A0/g, " ");
var escaped = s.replace(/[<>&"]/g, function(ch) {
return charMap [ch];
});
return escaped;
}
}
- Ngôn ngữ chính
- HTML
- Star
- 134
- Fork
- 10
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scripting/Scripting-News
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
scripting/Scripting-News#353 · 6 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
scripting/Scripting-News#332 · 25 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
scripting/Scripting-News#362 ·
-
Matt is moved aside Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
scripting/Scripting-News#361 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
scripting/Scripting-News#360 · 1 bình luận · 1 reaction ·
Tất cả issue của scripting/Scripting-News
Issue tương tự
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
syfoud/Simulated_Scepter#172 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
crossplane/crossplane#7859 ·
-
bot:ai-assisted component:compact-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
midnightntwrk/midnight-sdk#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nightscout/nocturne#1379 ·