• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to give space between words after tag (only followed by letter or number)

New Here ,
May 19, 2017 May 19, 2017

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);

TOPICS
Scripting

Views

389

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2017 May 21, 2017

Copy link to clipboard

Copied

Hi anyone please help this. kindly let me know for more information if required.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

Any update on this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

Is that required more info

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2017 May 22, 2017

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 22, 2017 May 22, 2017

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?

(這是什麼?)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

Kindly ignore this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

LATEST

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 都用不著就可以了。)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines