Copy link to clipboard
Copied
We need to insert space between the words with color and without color.
Example :
wordword - Input
word word - Output (with wordspce between words).
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>, the flames broke - Space need not give here
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>, the flames broke - (output - same as input)
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>the flames broke - Space need to give. (Input)
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref> the flames broke (Output)
Conditions
1. Space need to insert only the word followed by any letter or number [a-z] or [0-9].
2. Not in the word, word (word followed by comma, dot, or any punctuation).
We try to update this by coding but it will give word space on entire document, but we required only word followed by any letter or number [a-z] or [0-9].
var myRuleSet=new Array(new idList1)
with(doc)
{
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
}
function idList1()
{
this.name = "idList1";
this.xpath = "//xref[@role='green']";
this.apply = function(myElement, myRuleProcessor)
{
with(myElement)
{
//myElement.insertTextAsContent(" ",XMLElementPosition.BEFORE_ELEMENT);
Copy link to clipboard
Copied
Hi anyone please help this. kindly let me know for more information if required.
Copy link to clipboard
Copied
Any update on this.
Copy link to clipboard
Copied
Is that required more info
Copy link to clipboard
Copied
No Reply
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>the flames broke - Space need to give. (Input)
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref> the flames broke (Need Output)
Copy link to clipboard
Copied
Curious to ask,
(好奇問一下,)
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>the flames broke - Space need to give. (Input)
<xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref> the flames broke (Need Output)
what is this?
(這是什麼?)
Copy link to clipboard
Copied
Kindly ignore this.
Copy link to clipboard
Copied
Why do not you add spaces after all the words with color, and then fix the wrong spaces in turn?
For example, two spaces change back to a space, a space with a comma to change the comma or space plus a period to the period.
So that even grep do not need it.
(為什麼不先在所有有顏色的詞語後面加空格,然後反過來修正錯誤的空格?
例如說兩個空格變回一個空格、一個空格加上逗號變回逗號或者空格加上句號變回句號。
這樣連grep 都用不著就可以了。)