Parameters in Sauce links will only be expanded in the URL and displayed text.

This commit is contained in:
ccd0 2017-01-21 10:59:54 -08:00
parent 2dce5bedce
commit 60591fd13a
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div>
<div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div>
<div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div>
<ul>These parameters will be replaced by their corresponding values:
<ul>These parameters will be replaced by their corresponding values in the URL and displayed text:
<li><code>%TURL</code>: Thumbnail URL.</li>
<li><code>%URL</code>: Full image URL.</li>
<li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li>

View File

@ -32,7 +32,7 @@ Sauce =
ext = post.file.url.match(/[^.]*$/)[0]
skip = false
for key of parts
for key in ['url', 'text']
parts[key] = parts[key].replace /%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, (_, parameter) ->
type = Sauce.formatters[parameter] post, ext
if not type?