mirror of
https://github.com/dariusk/rss-to-activitypub.git
synced 2024-11-22 09:19:19 +02:00
Fixes to formatting and payload processing order
This commit is contained in:
parent
5012b8bb17
commit
737c418ed7
|
@ -18,8 +18,8 @@ async function foo() {
|
|||
const { id, payload } = await beanstalkd.reserve()
|
||||
console.log(payload)
|
||||
/* ... process job here ... */
|
||||
await doFeed(payload)
|
||||
await beanstalkd.delete(id)
|
||||
await doFeed(payload)
|
||||
} catch (err) {
|
||||
// Log error somehow
|
||||
console.error(err)
|
||||
|
@ -136,8 +136,8 @@ function transformContent(item) {
|
|||
});
|
||||
|
||||
// couple of hacky regexes to make sure we clean up everything
|
||||
item.content = $('body').html().replace(/^(\n|\r)/,'').replace(/>\r+</,' ').replace(/ +/g, '');
|
||||
item.content = item.content.replace(/^(\n|\r)/,'').replace(/>\r+</,' ').replace(/ +/g, '');
|
||||
item.content = $('body').html().replace(/^(\n|\r)/,'').replace(/>\r+</,'><').replace(/ +/g, '');
|
||||
item.content = item.content.replace(/^(\n|\r)/,'').replace(/>\r+</,'><').replace(/>\s*</g,'><').replace(/>\u200B+</g,'><').replace(/ +/g, '').replace(/<p><\/p>/g,'');
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue