diff --git a/src/General/Get.coffee b/src/General/Get.coffee index e2afc668a..ea47b5244 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -231,7 +231,6 @@ Get = new Board boardID thread = g.threads["#{boardID}.#{threadID}"] or new Thread threadID, board - post = new Post Build.post(o, true), thread, board, - isArchived: true + post = new Post Build.post(o, true), thread, board, {isArchived: true} Main.callbackNodes Post, [post] Get.insert post, root, context diff --git a/src/General/Main.coffee b/src/General/Main.coffee index a6ccd5503..e408fdb22 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -174,8 +174,7 @@ Main = posts = [] for postRoot in $$ '.thread > .postContainer', threadRoot try - posts.push post = new Post postRoot, thread, g.BOARD - post.cleanup() + posts.push post = new Post postRoot, thread, g.BOARD, {isOriginalMarkup: true} catch err # Skip posts that we failed to parse. errors = [] unless errors diff --git a/src/General/Post.coffee b/src/General/Post.coffee index dca023484..f3b69895b 100644 --- a/src/General/Post.coffee +++ b/src/General/Post.coffee @@ -6,6 +6,7 @@ class Post @ID = +root.id[2..] @fullID = "#{@board}.#{@ID}" + @cleanup root if that.isOriginalMarkup post = $ '.post', root info = $ '.postInfo', post @nodes = @@ -141,10 +142,10 @@ class Post if @file.isImage = /(jpg|png|gif)$/i.test @file.name @file.dimensions = fileText.textContent.match(/\d+x\d+/)[0] - cleanup: -> - for node in $$ '.mobile', @nodes.root + cleanup: (root) -> + for node in $$ '.mobile', root $.rm node - for node in $$ '.desktop', @nodes.root + for node in $$ '.desktop', root $.rmClass node, 'desktop' return