Commit Graph

76 Commits

Author SHA1 Message Date
rinpatch e4dc3f71ae Resolve merge conflict 2019-01-13 13:38:28 +03:00
William Pitcock 980b5288ed update copyright years to 2019 2018-12-31 15:41:47 +00:00
William Pitcock 2791ce9a1f add license boilerplate to pleroma core 2018-12-23 20:56:42 +00:00
Maksim f1b93b5be7 [#413] fix parse mentions 2018-12-20 09:35:01 +00:00
raeno 7fb3780431 Merge branch 'develop' into oembed_provider 2018-12-19 22:39:44 +04:00
rinpatch 059dd6f681 Ignore HTML characters in formatter.ex 2018-12-18 21:38:15 +03:00
raeno a300336459 Merge branch 'develop' into oembed_provider 2018-12-18 14:59:32 +01:00
Maksim Pechnikov bc6262d250 fixed typo 2018-12-14 21:21:37 +03:00
Maksim Pechnikov baead4ea4b fix markdown formatting 2018-12-14 16:03:58 +03:00
raeno b5de7c4c4d Remove oembed for now, will submit it in another MR. Fix warnings 2018-12-13 22:34:15 +01:00
raeno 8902942128 WIP. Implement oembed route and handle both json/xml for "Note" type activity 2018-12-13 22:17:53 +01:00
href 7214d57463
Extended nicknames: allow dashes. 2018-12-12 21:48:54 +01:00
href 7d9ddbe689
Allow underscores in usernames.
Fixes #429.
2018-12-12 18:57:33 +01:00
Vald 3ccfe226c0 added data attrs for user and tag 2018-12-06 01:05:41 +05:30
lain 4c918392c6 Fix most User tests. 2018-11-18 21:40:52 +01:00
href 5bb88fd174
Runtime configuration
Related to #85

Everything should now be configured at runtime, with the exception of
the `Pleroma.HTML` scrubbers (the scrubbers used can be
changed at runtime, but their configuration is compile-time) because
it's building a module with a macro.
2018-11-06 19:41:15 +01:00
href 763fc7b44f
Runtime configured emojis
The changes are a bit heavy since the emojis were loaded into module
attributes from filesystem.

This introduces a GenServer using an ETS table to cache in memory the
emojis, and allows a runtime-reload with `Pleroma.Emoji.reload()`.
2018-11-05 13:24:00 +01:00
scarlett ae5beb7b64 Make finmoji optional 2018-10-25 17:58:46 +01:00
kaniini ad3181895c Merge branch 'bugfix/html-scrub-schemes' into 'develop'
lib/pleroma/html.ex: Fix scheme lists

See merge request pleroma/pleroma!377
2018-10-18 14:36:40 +00:00
Haelwenn (lanodan) Monnier 2154c5dcd8
lib/pleroma/html.ex: Use macros for valid_schemes, change config for schemes 2018-10-18 07:58:15 +02:00
William Pitcock 582dbe5c8d formatter: fix matching osada users 2018-10-17 19:15:20 +00:00
William Pitcock 52b05137c5 formatter: use Pleroma.HTML module instead of HtmlSanitizeEx directly 2018-10-05 20:49:34 +00:00
William Pitcock b1be9415ef Revert "Merge branch 'revert-a26d5e6b' into 'develop'"
This reverts commit d31bbb1cfe, reversing
changes made to 340ab3cb90.
2018-10-05 20:49:34 +00:00
Haelwenn (lanodan) Monnier a3cffd3566
formatter: Stop using phoenix HTML and format it ourselves
* Pheonix has an extra scheme whitelist conflicting with ours
* Pheonix doesn’t seems to do URL encoding, just HTML encoding

Closes: https://git.pleroma.social/pleroma/pleroma/issues/307
2018-09-28 17:32:27 +02:00
William Pitcock ac486fc59b everywhere: use Pleroma.HTML module instead of HtmlSanitizeEx directly 2018-09-10 00:14:47 +00:00
kaniini 7ca2a2ddea Merge branch 'nil-bio-emojis' into 'develop'
add nil clause for Formatter.get_emoji/1 to return an empty result

Closes #274

See merge request pleroma/pleroma!315
2018-09-03 05:54:11 +00:00
Thurloat 4257f784bc sloop around get_emoji/1 to check is_binary and have a fallthrough
default that returns empty
2018-09-02 20:44:37 -03:00
William Pitcock 834515fb51 formatter: don't add XSS emoji 2018-09-02 00:04:09 +00:00
Thurloat a9c0f395cb add nil clause for Formatter.get_emoji/1 to return an empty result 2018-08-31 14:29:23 -03:00
lambda 58539e1357 Revert "Merge branch 'feature/rich-text' into 'develop'"
This reverts merge request !309
2018-08-31 09:51:20 +00:00
William Pitcock 6aa65b68b8 common api: add support for formatting messages outside of twitter-style plain text 2018-08-31 03:13:59 +00:00
William Pitcock 3e10d13909 formatter: adjust regexp captures to match local users with single character nicknames (closes #163) 2018-08-24 18:22:47 +00:00
kaniini 183ccd1812 Merge branch 'dev-lanodan-url-regex' into 'develop'
lib/pleroma/formatter.ex: Fix URL regex

Closes #127

See merge request pleroma/pleroma!69
2018-08-16 15:41:16 +00:00
William Pitcock 0ee29994a5 formatter: preserve case of hashtags
when generating hashtag links, we used the casefolded version that we use in
the link URLs, instead of the original version.

accordingly, adjust the formatter to use the original text for the links, while
keeping the casefolded version for the URLs.
2018-08-05 00:37:38 +00:00
Haelwenn (lanodan) Monnier d5091c3175
Allow additionnal schemes in the config 2018-08-01 02:52:42 +02:00
Haelwenn (lanodan) Monnier 3623504e5d
[Pleroma.Formatter]: Add support for non-HTTP schemes in URIs
The call to the regex in add_links is there just to be sure it’s a legal URI, it can be removed if you want to get more performance.

The URI Schemes list is sorted, but with http(s) at the start (in case it might make it faster for common links).

Closes: https://git.pleroma.social/pleroma/pleroma/issues/127
2018-07-30 22:01:48 +02:00
Jorty 748fff6544 Fix auto-shortcode emoji
Emoji were broken due to `Pleroma.Formatter` not knowing about the
auto-shortcode emoji. This moves that logic from
`Pleroma.Web.TwitterAPI.UtilController` to `Pleroma.Formatter`.

Additionally, it's now possible to specify multiple shortcode globs, and
the default globs were changed to `["/emoji/custom/**/*.png"]`, since
that's in the .gitignore and the files there would have to be shortcode
emoji anyway.
2018-06-30 21:31:08 -04:00
William Pitcock d7eb2e1b65 run mix format 2018-05-27 13:06:38 +00:00
William Pitcock a8df7fc690 formatter: use class='mention' on links to user profiles
helps mastodon frontend and apps have better context:
https://mastodon.social/users/Gargron/statuses/100101267352899379
2018-05-27 12:56:24 +00:00
Thog 6f39ecc41b
Support Undo like activities (Fix #139) 2018-05-19 22:14:15 +02:00
lain df95118c81 Fix linking problem. 2018-05-19 11:27:14 +02:00
lain 0574df273c Small cleanup. 2018-04-22 10:01:10 +02:00
lain 0c221943ef Formatter: Use proper escaping for links. 2018-04-21 18:27:31 +02:00
lain 60f92e406c Accept port number in urls. 2018-04-06 16:35:54 +02:00
lain 81600c94f4 Handle + in links. 2018-04-04 11:29:03 +02:00
lain 806550c921 Use user url in mention if we have it. 2018-04-03 18:32:46 +02:00
lain 4afbef39f4 Format the code. 2018-03-30 15:01:53 +02:00
lain df8fc72491 Don't go through all available emoji.
object carry their emoji information.
2018-03-28 09:56:32 +02:00
Francis Dinh 61692c7efa Include the '#' symbol into the link itself 2018-03-27 02:00:04 -04:00
lain eb7ce61ca5 Fix hashtags. 2018-03-24 11:03:10 +01:00