Skip to content
Snippets Groups Projects
  1. Feb 25, 2020
  2. Sep 11, 2019
  3. Aug 23, 2019
    • Jan Provaznik's avatar
      Re-escape whole HTML content instead of only match · a98b89e9
      Jan Provaznik authored
      When we un-escape HTML text to find references in it, we should then
      re-escape the whole text again, not only found matches.
      
      Because we replace matches with milestone/label links (which contain
      HTML tags we don't want to escape again), we re-escape HTML text
      with placeholders instead of these links and then replace placeholders
      in the escaped text.
      a98b89e9
  4. Jun 05, 2019
    • Patrick Bajao's avatar
      Use Redis for CacheMarkDownField on non AR models · 2eecfd8f
      Patrick Bajao authored
      This allows using `CacheMarkdownField` for models that are not backed
      by ActiveRecord.
      
      When the including class inherits `ActiveRecord::Base` we include
      `Gitlab::MarkdownCache::ActiveRecord::Extension`. This will cause the
      markdown fields to be rendered and the generated HTML stored in a
      `<field>_html` attribute on the record. We also store the version
      used for generating the markdown.
      
      All other classes that include this model will include the
      `Gitlab::MarkdownCache::Redis::Extension`. This add the `<field>_html`
      attributes to that model and will generate the html in them. The
      generated HTML will be cached in redis under the key
      `markdown_cache:<class>:<id>`. The class this included in must
      therefore respond to `id`.
      2eecfd8f
Loading