Commit 425711a6 by Edgar Hipp

added replacebynothing method

parent 8cab9112
...@@ -21,6 +21,13 @@ class ImageModule ...@@ -21,6 +21,13 @@ class ImageModule
name="image_generated_#{@imageNumber}.png" name="image_generated_#{@imageNumber}.png"
@imageNumber++ @imageNumber++
name name
replaceByNothing:()->
xmlTemplater=@manager.getInstance('xmlTemplater')
subContent=new SubContent(xmlTemplater.content)
.getInnerTag(templaterState)
.getOuterXml('w:t')
xmlTemplater.replaceXml(subContent,'<w:t></w:t>')
handle:(type,data)-> handle:(type,data)->
if type=='replaceTag' and data=='image' if type=='replaceTag' and data=='image'
scopeManager=@manager.getInstance('scopeManager') scopeManager=@manager.getInstance('scopeManager')
...@@ -29,11 +36,12 @@ class ImageModule ...@@ -29,11 +36,12 @@ class ImageModule
tag = templaterState.textInsideTag.substr(1) tag = templaterState.textInsideTag.substr(1)
imgName=scopeManager.getValueFromScope(tag) imgName=scopeManager.getValueFromScope(tag)
if imgName=='undefined' then return
if imgName=='undefined' then return @replaceByNothing()
try try
imgData=fs.readFileSync(imgName) imgData=fs.readFileSync(imgName)
catch e catch e
return return @replaceByNothing()
rId=@imgManager rId=@imgManager
.loadImageRels() .loadImageRels()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment