RSS Improvements to allow more template Tags like ([RSS_ENTRY_TITLE], [RSS_ENTRY_DATE], [RSS_ENTRY_LINK], [RSS_ENTRY_CONTENT], [RSS_ENTRY_SUMMARY], [RSS_ENTRY_IMAGE_URL])
This commit is contained in:
parent
c4b80fff93
commit
92bffd78de
2 changed files with 8 additions and 3 deletions
|
@ -132,8 +132,11 @@ function checkEntries(parent, entries, callback) {
|
|||
let entryId = result.insertId;
|
||||
let html = (parent.html || '').toString().trim();
|
||||
|
||||
if (/\[RSS_ENTRY\]/i.test(html)) {
|
||||
html = html.replace(/\[RSS_ENTRY\]/, entry.content);
|
||||
if (/\[RSS_ENTRY[\w]*\]/i.test(html)) {
|
||||
html = html.replace(/\[RSS_ENTRY\]/, entry.content); //for backward compatibility
|
||||
Object.keys(entry).forEach(key => {
|
||||
html = html.replace('\[RSS_ENTRY_'+key.toUpperCase()+'\]', entry[key])
|
||||
});
|
||||
} else {
|
||||
html = entry.content + html;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue