deal with relative URLs in JSON properly

This commit is contained in:
ccd0 2014-04-19 22:01:08 -07:00
parent 253de9b2cb
commit bbcec90c22

View File

@ -197,10 +197,14 @@ Build =
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
innerHTML: <%= grunt.file.read('src/General/html/Build/post.html').replace(/>\s+/g, '>').replace(/\s+</g, '<').replace(/\s+/g, ' ').trim() %>
# Fix pathnames
for quote in $$ '.quotelink', container
href = quote.getAttribute 'href'
continue if href[0] is '/' # Cross-board quote, or board link
quote.href = "/#{boardID}/thread/#{href}" # Fix pathnames
if href[0] is '#'
quote.href = "/#{boardID}/thread/#{threadID}#{href}"
else
quote.href = "/#{boardID}/thread/#{href}"
container