Skip to content

Commit

Permalink
add basic paywall-type block renderer
Browse files Browse the repository at this point in the history
it isn't good and it'll probably never need to be used but
it's better than the interface crashing when fed a real post
  • Loading branch information
AprilSylph committed Oct 14, 2021
1 parent 866abb8 commit 088159d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/npf.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ const blockRenderers = {
a.append('(video)');
});
}
},

paywall ({ title, text }) {
return document.createElement('details').tap(details => details.append(
Object.assign(document.createElement('summary'), { textContent: title }),
Object.assign(document.createElement('p'), { textContent: text })
));
}
};

Expand Down

0 comments on commit 088159d

Please sign in to comment.