From dc248f8d29d72d79faf54b5d9ee2605ccdc14290 Mon Sep 17 00:00:00 2001 From: Robin Yang Date: Fri, 22 Jan 2016 13:21:17 -0800 Subject: [PATCH] Add additional formatting tags to Tome popup Helps fix this #2945 --- app/views/play/level/tome/DocFormatter.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/play/level/tome/DocFormatter.coffee b/app/views/play/level/tome/DocFormatter.coffee index 72644029d..94122cd20 100644 --- a/app/views/play/level/tome/DocFormatter.coffee +++ b/app/views/play/level/tome/DocFormatter.coffee @@ -154,7 +154,10 @@ module.exports = class DocFormatter content = popoverTemplate doc: @doc, docName: docName, language: @options.language, value: @formatValue(), marked: marked, argumentExamples: argumentExamples, writable: @options.writable, selectedMethod: @options.selectedMethod, cooldowns: @inferCooldowns(), item: @options.item owner = if @doc.owner is 'this' then @options.thang else window[@doc.owner] content = @replaceSpriteName content - content.replace /\#\{(.*?)\}/g, (s, properties) => @formatValue downTheChain(owner, properties.split('.')) + content = content.replace /\#\{(.*?)\}/g, (s, properties) => @formatValue downTheChain(owner, properties.split('.')) + content = content.replace /{([a-z]+)}([^]*?){\/\1}/g, (s, language, text) => + if language is @options.language then return text + return '' replaceSpriteName: (s) -> # Prefer type, and excluded the quotes we'd get with @formatValue