feed: render links in text notes #29

Merged
offbyn merged 2 commits from feed-reduce-many-newlines into master 2 years ago
offbyn commented 2 years ago
Owner

Links should be rendered as anchors so that they are clickable.
For now only links starting with http:// https:// or www. are supported.

part of #30

Links should be rendered as anchors so that they are clickable. For now only links starting with http:// https:// or www. are supported. part of https://git.qcode.ch/nostr/nostrweb/issues/30
offbyn self-assigned this 2 years ago
offbyn added 1 commit 2 years ago
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
7ba31a6b92
feed: reduce and censor content that has many newlines
Render newlines as linebreaks is nice, but it can be abused by
adding too many newlines. This change reduces 3 newlines to 2
globally to keep the output somewhat sane.
offbyn requested review from x1ddos 2 years ago
offbyn commented 2 years ago
Poster
Owner

@x1ddos WDYT?

@x1ddos WDYT?
offbyn reviewed 2 years ago
src/main.js Outdated
@ -157,3 +157,3 @@
const {host, img, isReply, name, replies, time, userName} = getMetadata(evt, relay);
const isLongContent = evt.content.trimRight().length > 280;
const content = isLongContent ? evt.content.slice(0, 280) : evt.content;
const content = (isLongContent ? evt.content.slice(0, 280) : evt.content).replaceAll(/\n{3,}/g, '\n\n');
offbyn commented 2 years ago
Poster
Owner

maybe it should just be part of multilineText utils (which is called later in this function).

maybe it should just be part of multilineText utils (which is called later in this function).
offbyn commented 2 years ago
Poster
Owner

moved to multilineText from domutils

moved to multilineText from domutils
offbyn force-pushed feed-reduce-many-newlines from 7ba31a6b92 to ed49e8afa8 2 years ago
x1ddos approved these changes 2 years ago
x1ddos left a comment
Owner

sounds very reasonable. lgtm.

sounds very reasonable. lgtm.
offbyn added 1 commit 2 years ago
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
1ef008ca90
feed: render link in text notes
Links should be rendered as anchors so that they are clickable.
For now only links starting with http:// https:// or www. are
supported.

Temporary disabled text notes shortening.
offbyn force-pushed feed-reduce-many-newlines from 1ef008ca90 to d9d95bb835 2 years ago
offbyn force-pushed feed-reduce-many-newlines from d9d95bb835 to 8ec9420be8 2 years ago
offbyn changed title from feed: reduce and censor content that has many newlines to feed: render links in text notes 2 years ago
offbyn merged commit 8ec9420be8 into master 2 years ago
offbyn deleted branch feed-reduce-many-newlines 2 years ago

Reviewers

x1ddos approved these changes 2 years ago
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
The pull request has been merged as 8ec9420be8.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b feed-reduce-many-newlines master
git pull origin feed-reduce-many-newlines

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff feed-reduce-many-newlines
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nostr/nostrweb#29
Loading…
There is no content yet.