Hi
I think there might be a bug which means that TBS does not understand the TBS codes correctly when you edit them in word. I have created an example, start with a blank word document and type in:
This is my first bit of text [onshow;block=tbs:p;when'[Fruit_Type]'~='/(.*Apple.*|Pear)/']
This is my second bit of text |
I highlight the TBS code in red to make it clearer and this might have a bearing on the issue. The XML for the above looks like:
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00B66139">
-<w:r>
<w:t xml:space="preserve">This is my first bit of text </w:t>
</w:r>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>[onshow</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>;block</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>=</w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>tbs:p;when</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>'[Fruit_Type]'~='/(.*Apple.*|Pear)/']</w:t>
</w:r>
<w:bookmarkEnd w:id="0"/>
</w:p>
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00377DC9">
-<w:r>
<w:t>This is my second bit of text</w:t>
</w:r>
</w:p> |
If I then copy and paste the same code in word and make it look for Orange instead of Apple (just overtyping the text), so it now looks like this in word...
This is my first bit of text [onshow;block=tbs:p;when'[Fruit_Type]'~='/(.*Apple.*|Pear)/']
This is my second bit of text
This is my first bit of text [onshow;block=tbs:p;when'[Fruit_Type]'~='/(.*Orange.*|Pear)/']
This is my second bit of text |
The TBS code is still highlighted in red and now the XML code looks like this...
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00B66139">
-<w:r>
<w:t xml:space="preserve">This is my first bit of text </w:t>
</w:r>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>[onshow</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>;block</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>=</w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>tbs:p;when</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>'[Fruit_Type]'~='/(.*Apple.*|Pear)/']</w:t>
</w:r>
</w:p>
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00377DC9">
-<w:r>
<w:t>This is my second bit of text</w:t>
</w:r>
</w:p>
<w:p w:rsidP="00B66139" w:rsidRDefault="00AD6348" w:rsidR="00AD6348"/>
-<w:p w:rsidP="00AD6348" w:rsidRDefault="00AD6348" w:rsidR="00AD6348">
-<w:r>
<w:t xml:space="preserve">This is my first bit of text </w:t>
</w:r>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>[onshow</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>;block</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>=</w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>tbs:p;when</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>'[Fruit_Type]'~='/(.*</w:t>
</w:r>
-<w:r>
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>Orange</w:t>
</w:r>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
<w:bookmarkEnd w:id="0"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>.*|Pear)/']</w:t>
</w:r>
</w:p>
-<w:p w:rsidP="00AD6348" w:rsidRDefault="00AD6348" w:rsidR="00AD6348">
-<w:r>
<w:t>This is my second bit of text</w:t>
</w:r>
</w:p> |
The first bit of XML is the same, the second copy though, you can see the Orange bit of the TBS string is now split up. This seems to cause TBS to fail (i.e. it will not show the second line of text in my example) but it will remove the TBS command so I think in the background the TBS code must be putting a space or something causing the pattern not to match.
To fix the problem I have to clear the formats and then the XML looks fine (I reapply the red text to the TBS code mind):
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00B66139">
-<w:r>
<w:t xml:space="preserve">This is my first bit of text </w:t>
</w:r>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>[onshow</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>;block</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>=</w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>tbs:p;when</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
-<w:r w:rsidRPr="00B66139">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>'[Fruit_Type]'~='/(.*Apple.*|Pear)/']</w:t>
</w:r>
</w:p>
-<w:p w:rsidP="00B66139" w:rsidRDefault="00B66139" w:rsidR="00377DC9">
-<w:r>
<w:t>This is my second bit of text</w:t>
</w:r>
</w:p>
<w:p w:rsidP="00B66139" w:rsidRDefault="00AD6348" w:rsidR="00AD6348"/>
-<w:p w:rsidP="001B48F9" w:rsidRDefault="00AD6348" w:rsidR="00AD6348" w:rsidRPr="001B48F9">
-<w:r w:rsidRPr="001B48F9">
<w:t xml:space="preserve">This is my first bit of text </w:t>
</w:r>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
-<w:r w:rsidRPr="001B48F9">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>[onshow</w:t>
</w:r>
<w:proofErr w:type="gramStart"/>
-<w:r w:rsidRPr="001B48F9">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>;block</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
-<w:r w:rsidRPr="001B48F9">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>=</w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
-<w:r w:rsidRPr="001B48F9">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>tbs:p;when</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
-<w:r w:rsidRPr="001B48F9">
-<w:rPr>
<w:color w:val="FF0000"/>
</w:rPr>
<w:t>'[Fruit_Type]'~='/(.*Orange.*|Pear)/']</w:t>
</w:r>
<w:bookmarkEnd w:id="0"/>
</w:p>
-<w:p w:rsidP="001B48F9" w:rsidRDefault="00AD6348" w:rsidR="00AD6348" w:rsidRPr="001B48F9">
-<w:r w:rsidRPr="001B48F9">
<w:t>This is my second bit of text</w:t>
</w:r>
</w:p> |
As you can see the TBS code now looks like the first line. This is a real pain because from word it looks fine but the code does not work. Is there a way to fix this or is it a problem in the plugin or something?
Thanks in advance