Commit Graph

164 Commits

Author SHA1 Message Date
Vinoth Kannan 2076f371b3 FIX: Hashtags should work for non-english characters 2018-12-26 22:12:40 +05:30
Sam Saffron 69aa8f18c2 FEATURE: allow for custom excerpt BBCODE
This allows fidelity in controlling excerpt (text that shows up when you pin a topic or link to it externally):

```
I am some text

[excerpt]
This is some **custom** markdown that should be the excerpt
[/excerpt]

More text
```

Previous solution relied on DIVs, unfortunately DIVs do not play well,
by design with mixing markdown unless you have a preceding newline eg:

```
<div class='hello'>

this will be treated properly as markdown

</div>
```

This extra newline is not desirable.

I am also considering adding

```
[div class=excerpt]
[/div]
```

This would offer lots of flexibility to themes and plugins that do not want the extra annoying newline.
2018-12-25 17:02:28 +02:00
Bianca Nenciu a8e8473ea5 DEV: Apply code review. 2018-12-05 21:58:55 +01:00
Bianca Nenciu e9bbdef156 FEATURE: Add support for inline emoji translation. 2018-12-05 21:58:55 +01:00
Sam 5c17e46274 FEATURE: allow advanced specification of excerpts for posts
Previously users could control excerpt with `<span class='excerpt'>`
in Markdown, this is somewhat limited for plugins that need to define this
across a section. This adds support for DIV as well
2018-12-04 15:13:34 +11:00
Guo Xiang Tan a1e77aa2ed
FEATURE: Reimplement `SiteSetting.max_oneboxes_per_post`. (#6668)
Previously, the site setting was only effective on the client side of
things. Once the site setting was been reached, all oneboxes are not
rendered. This commit changes it such that the site setting is respected
both on the client and server side. The first N oneboxes are rendered and
once the limit has been reached, subsequent oneboxes will not be
rendered.
2018-11-27 16:00:31 +08:00
Guo Xiang Tan 57e2f4990d
PERF: Move processing of inline onebox out of V8 context. (#6658) 2018-11-26 09:21:38 +08:00
Guo Xiang Tan c5a70eca6e
PERF: Move mention lookups out of the V8 context. (#6640)
We were looking up each mention one by one without any form of caching and that results
in a problem somewhat similar to an N+1. When we have to do alot of DB
lookups, it also increased the time spent in the V8 context which may
eventually lead to a timeout. The change here makes it such that mention lookups only does a single
DB query per post that happens outside of the V8 context.
2018-11-22 14:28:48 +08:00
Joffrey JAFFEUX 58c795ef30 DEV: adds test for image-short-url (#6642) 2018-11-22 07:48:52 +11:00
Sam 0a86ef69bb FIX: browser infinite recursion when editing post
This was a result of:

c4ed353fae

jQuery map on a jQuery object, returns a jQuery object http://api.jquery.com/map/

So you need to convert it to an array prior to mapping
2018-11-21 12:51:14 +11:00
Joffrey JAFFEUX c4ed353fae DEV: removes _.map from codebase (#6616) 2018-11-19 10:46:46 +01:00
Vinoth Kannan 44d95ad5ab FIX: Cache url data for failed inline oneboxes 2018-11-13 01:44:20 +05:30
David Taylor 3c2608d41c
FIX: Correctly censor strings starting or ending with non-word characters (#6445) 2018-10-04 15:15:10 +01:00
Vinoth Kannan fe6c3b7d2e Make prettier happy 2018-09-04 00:31:41 +05:30
Vinoth Kannan 24a14af15a FIX: Respect invalidate_oneboxes option for inline oneboxes 2018-09-03 22:33:43 +05:30
Sam 280c318c49 FEATURE: allow ruby tags in Markdown 2018-08-03 11:47:36 +10:00
Sam 0b3d51a8bc FEATURE: whitelist lang attribute 2018-08-02 16:53:08 +10:00
OsamaSayegh f13a7226db FIX: display tables in posts history diff (#6032) 2018-07-12 14:13:52 +10:00
Sam b54ba4c952 FIX: mentions broken after adding an <abbr> tag
A previous shortcut used was not allowing for <abbr and other tags starting with a

If <abbr> appeared anywhere in the text all mentions would fail to link
2018-07-05 09:27:11 +10:00
Joffrey JAFFEUX 03a7d532cf
DEV: introduces prettier for es6 files 2018-06-15 17:03:24 +02:00
Joffrey JAFFEUX dd76ba90b3
FIX: bbcode regex was greedy and preventing quotes 2018-05-23 11:55:02 +02:00
Joffrey JAFFEUX 691174fa8f
FEATURE: adds emoji search aliases 2018-05-01 15:43:49 +02:00
Sam a0cd54750c FIX: inline [code] not handled properly
The text

a
[code]test[/code]

Would eat up the `test` text cause translation from inline to block
for replace rule was not properly handled
2018-04-26 15:18:22 +10:00
Robin Ward 58c81db279 Apply a 'no-group' class to quotes for styling 2018-04-02 14:02:16 -04:00
Robin Ward 90d3544db8 UX: Add a class we can use to target quotes without groups 2018-04-02 14:02:16 -04:00
Robin Ward 31a0c4a9be FEATURE: Add `quote-modified` class if a quote has been modified 2018-03-13 13:41:06 -04:00
Arpit Jalan 322618fc34 FIX: capital bbcode tags were broken 2018-03-04 22:10:54 +05:30
Sam d39d2b9352 FEATURE: whitelist data for themes 2018-03-02 14:52:09 +11:00
Neil Lalonde 3313072957 Remove censored_pattern site setting, which is replaced by watched words 2018-02-26 16:29:27 -05:00
Régis Hanol 60ec483caa FIX: include title in local onebox when linking to a different topic 2018-02-19 22:40:14 +01:00
hnb-ku afdc559f4f FEATURE: Whitelist div[data-theme-*] (#5598)
* Whitelist div[data-theme-*]

Whitelisting data attributes on <div> elements that match [data-theme-*] allows theme authors to target elements in posts and not have those attributes sanitized. 

https://meta.discourse.org/t/79520/16

* Update white-lister.js.es6
2018-02-15 04:32:41 -05:00
Sam f028ffaf29 SECURITY: correct local onebox category checks
Also removes ugly "source_topic_id" from cooked posts

Patch was authored by @zogstrip

Signed-off-by: Sam <sam.saffron@gmail.com>
2018-02-14 10:40:46 +11:00
Sam 60ee9a4ccf make tests a bit happier 2018-02-01 15:56:22 +11:00
Sam ee0d3f15c1 FEATURE: allow better fidelity for auto linkify, disable most tlds based linkify
New site settings:

enable_markdown_linkify: which is default on, auto links https:// and http:// and mail://

markdown_linkify_tlds: which allows control of what tlds get autolinked for cases such as www.site.com, default is com|net|gov
2018-02-01 13:22:38 +11:00
Maja Komel 330912e1e5 FIX: allowed href scheme link can start with a + (#5537)
* allowed href scheme link can start with a +

* allow tel:// links only to start with +

* add missing semicolon

* add test
2018-01-30 11:02:23 +11:00
Sam f946db4afe FIX: inline oneboxer min title length of 2
also: cache mini onebox misses as well to cut down traffic
2018-01-30 08:40:04 +11:00
Neil Lalonde dc97239040 FIX: censored regex words were replacing other text that shouldn't be censored 2018-01-24 12:33:47 -05:00
Sam 3492a91056 FEATURE: allow site operators to disable emoji shortcuts 2018-01-24 12:21:44 +11:00
Neil Lalonde edb3a7f646 FIX: support for watched_words_regular_expressions when censoring words 2018-01-10 14:11:23 -05:00
Neil Lalonde ad62f1099c FIX: censored words should support * as wildcard 2018-01-09 15:53:40 -05:00
Sam a9e2fc59c4 FIX: [constructor] bbcode would cause markdown crash 2017-12-27 16:11:30 +11:00
Joffrey JAFFEUX fd99e1ef56 FEATURE: site setting enable_mentions to turn on/off mentions 2017-12-07 16:27:58 -05:00
Guo Xiang Tan 4531563717 Hide new advanced editor and preview sync behind a hidden site settings. 2017-12-06 12:34:58 +08:00
Guo Xiang Tan 44333c5de3 REFACTORY: Dry up some composer syncing code. 2017-11-24 14:57:36 +08:00
Guo Xiang Tan 486016acea UX: Improve editor and preview scroll syncing. 2017-11-23 17:02:02 +08:00
Sam d43a54e83a FIX: use current_user.id in onebox instead of param 2017-11-23 15:32:19 +11:00
Robin Ward f8164956dd Add quote and mention support for username formatters 2017-11-20 16:28:03 -05:00
Sam 38c103c75e correct spec 2017-11-13 18:09:24 +11:00
Sam 8a66446849 FEATURE: add overflow-y auto to Markdown tables 2017-11-13 17:52:15 +11:00
Sam 232311aa8c FIX: missing short image resolution on queued posts 2017-11-13 12:08:11 +11:00