lib/polytexnic/preprocessors/polytex.rb
def cache_image_locations(text)
        # Matches '![Image caption](/path/to/image)'
        text.gsub!(/^\s*(!\[.*?\])\((.*?)\)/) do
          key = digest($2)
          $cache[key] = $2
          "\n#{$1}(#{key})"
        end
      end
# Caches the locations of images to be passed through the pipeline.
# This works around a Kramdown bug, which fails to convert images
# properly when their location includes a URL.
Caches the locations of images to be passed through the pipeline.
This works around a Kramdown bug, which fails to convert images
properly when their location includes a URL.
Caches the locations of images to be passed through the pipeline . This works around a Kramdown bug which fails to convert images properly when their location includes a URL .
def cache_image_locations(text)
        text.gsub!(/^\s*(!\[.*?\])\((.*?)\)/) do
          key = digest($2)
          $cache[key] = $2
          "\n#{$1}(#{key})"
        end
      end
def cache_image_locations ( text ) text . gsub! ( / ^ \s *(! \[ .*? \] ) \( (.*?) \) / ) do key = digest ( $2 ) $cache [ key ] = $2 "\n#{$1}(#{key})" end end
Caches the locations of images to be passed through the pipeline.
Caches the locations of images to be passed through the pipeline .
# Matches '![Image caption](/path/to/image)'
text