Commit graph

19 commits

Author SHA1 Message Date
Brett Walker
750af9fd32 Use proper markdown rendering for previews 2018-07-06 18:49:33 +00:00
Brett Walker
f79410fe17 enable CommonMark as the default 2018-06-14 08:30:16 +00:00
Brett Walker
36a5a2c331 for cached markdown fields, select the correct engine
and also make sure that if a field is saved, then the existing cache version is maintained or only upgraded to the version with the same markdown engine.
2018-04-17 17:42:19 +02:00
Nick Thomas
a0c4f00595
Use relative URLs when linking to uploaded files 2017-12-22 15:09:16 +00:00
Greg Stark
e8ab4d92b4 Treat empty markdown and html strings as valid cached text, not missing cache that needs to be updated 2017-12-12 14:01:53 +00:00
Jarka Kadlecova
064c8949bd CE port of code changed for epics 2017-11-02 07:14:35 +01:00
Toon Claes
d13669716a Create idea of read-only database
In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo
secondary node). But in GitLab CE it also might be useful to have the
"read-only" idea around. So port it back to GitLab CE.

Also having the principle of read-only in GitLab CE would hopefully
lead to less errors introduced, doing write operations when there
aren't allowed for read-only calls.

Closes gitlab-org/gitlab-ce#37534.
2017-10-06 22:37:40 +02:00
Robert Speicher
260c8da060 Whitelist or fix additional Gitlab/PublicSend cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
Tim Zallmann
52b8a0db68 Resolve "Lazy load images on the Frontend" 2017-07-24 17:36:52 +00:00
Nick Thomas
6d63d766d1 Fix stubbing attributes alongside cache_markdown_field 2017-07-05 18:25:45 +01:00
Bob Van Landuyt
3dd2476eb3 Refresh the markdown cache if it was nil
If the cached html_field for a markdown_field is `nil` while the
mfarkdown_field is not, it needs to be refreshed.
2017-05-02 15:24:41 +02:00
Nick Thomas
cb1207af36 Swap a before_save call with a before_create/before_update pair to avoid a confict with elasticsearch-model 2017-04-25 15:22:56 +01:00
Nick Thomas
d2b883b750 Start versioning cached markdown fields 2017-04-21 17:24:33 +01:00
Nick Thomas
e9819de10a Remove the ClearDatabaseCacheWorker 2017-04-21 11:52:28 +01:00
Douwe Maan
32a7041030 ActiveSupport delegation is preferred over Forwardable 2017-02-23 09:32:42 -06:00
Douwe Maan
b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Jarka Kadlecova
0c350b7939 address comments 2017-01-25 10:10:05 +01:00
Jarka Kadlecova
bf708e55c2 make mentions working when project not specified 2017-01-18 18:38:17 -05:00
Nick Thomas
e94cd6fdfe Add markdown cache columns to the database, but don't use them yet
This commit adds a number of _html columns and, with the exception of Note,
starts updating them whenever the content of their partner fields changes.

Note has a collision with the note_html attr_accessor; that will be fixed later

A background worker for clearing these cache columns is also introduced - use
`rake cache:clear` to set it off. You can clear the database or Redis caches
separately by running `rake cache:clear:db` or `rake cache:clear:redis`,
respectively.
2016-10-07 02:54:25 +01:00