mirror of
https://github.com/aureliendavid/rsspreview.git
synced 2025-08-24 12:18:38 +00:00
unhtml entry titles
This commit is contained in:
parent
d9aa4e58c6
commit
a422b7c9c6
4
rss.xsl
4
rss.xsl
@ -43,11 +43,11 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="link | atom:link/@href | rss1:link">
|
<xsl:when test="link | atom:link/@href | rss1:link">
|
||||||
<a href="{link | atom:link/@href | rss1:link}" target="_blank">
|
<a href="{link | atom:link/@href | rss1:link}" target="_blank">
|
||||||
<span><xsl:value-of select="title | atom:title | rss1:title" /></span>
|
<span class="entrytitle"><xsl:value-of select="title | atom:title | rss1:title" /></span>
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<span><xsl:value-of select="title | atom:title | rss1:link" /></span>
|
<span class="entrytitle"><xsl:value-of select="title | atom:title | rss1:link" /></span>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
||||||
|
@ -129,6 +129,32 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function formattitles() {
|
||||||
|
|
||||||
|
var et = document.getElementsByClassName("entrytitle");
|
||||||
|
console.log(et);
|
||||||
|
for (var i = 0; i<et.length; i++) {
|
||||||
|
|
||||||
|
//basically removes html content if there is some
|
||||||
|
//only do it if there's a tag to avoid doing it when text titles cointain a '&'
|
||||||
|
//(which can be caught but still displays an error in console, which is annoying)
|
||||||
|
|
||||||
|
if (et[i].innerText.indexOf('<') >= 0) {
|
||||||
|
|
||||||
|
var tmp = document.createElement("span");
|
||||||
|
try {
|
||||||
|
tmp.innerHTML = et[i].innerText;
|
||||||
|
et[i].innerText = tmp.textContent;
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function addfeedurl(url) {
|
function addfeedurl(url) {
|
||||||
|
|
||||||
var h1 = document.getElementById("feedTitleText");
|
var h1 = document.getElementById("feedTitleText");
|
||||||
@ -215,6 +241,7 @@
|
|||||||
formatdescriptions();
|
formatdescriptions();
|
||||||
formatfilenames();
|
formatfilenames();
|
||||||
formatfilesizes();
|
formatfilesizes();
|
||||||
|
formattitles();
|
||||||
extensionimages();
|
extensionimages();
|
||||||
|
|
||||||
document.title = /*"RSSPreview: " + */document.getElementById("feedTitleText").innerText;
|
document.title = /*"RSSPreview: " + */document.getElementById("feedTitleText").innerText;
|
||||||
|
Loading…
Reference in New Issue
Block a user