Copy link to clipboard
Copied
When I export the InDesign file that I was given by a designer to HTML there are hundreds of language span tags scattered all over the place. Example below.
How can I remove these language spans from the InDesign file instead of having to remove them manually from the HTML file?
<p>
<span lang="fr-FR"><a id="_idTextAnchor002"></a>En cherchant </span
><span lang="ar-SA">à </span
><span lang="fr-FR"
>appuyer un élève, certains pédagogues interviennent personnellement et
posent des gestes inappropriés<a id="_idTextAnchor003"></a>. D’autres –
aussi rares soient-ils – ne se préoccupent pas du bienêtre de l’</span
><span lang="ar-SA">élève, mais </span><span lang="fr-FR">cherchent</span
><span lang="ar-SA"> délibérément</span><span lang="fr-FR"> à le </span
><span lang="ar-SA">«</span><span lang="fr-FR">conditionner</span
><span lang="ar-SA">»</span
><span lang="fr-FR"> dans le but d’entretenir </span
><span lang="ar-SA">éventuellement </span
><span lang="fr-FR"
>une relation de nature sexuelle. <a id="_idTextAnchor004"></a>Souvent, ce
mécanisme, que nous appellerons «pédopiégeage» (</span
><span lang="fr-FR">grooming</span
><span lang="fr-FR"
>, en anglais), ne peut être mis au jour qu’après coup, par la police,
l’employeur, l’Ordre et les victimes elles-m</span
>ê<span lang="fr-FR">mes. </span>
</p>
Basically you could reach all text in your document with a GREP find action and format the result.
If you have tables in your document you perhaps need additional GREP runs, because a table special character can stop a result range prematurely.
Plus: One TEXT find action that reaches all the special characters that represent the tables in a text stream.
Suggested GREP search: Scope should be Document.
Include: Locked Layers, Hidden Layers, Master Pages and Footnotes.
This GREP would not be s
...Copy link to clipboard
Copied
Hi,
I assume, I did not test this, you can do this by setting all texts in your document to language [No Language].
It's a formatting option of text you can find in the paragraph styles, the paragraph options for selected text, the character styles and the character options for selected text.
However: This will ruin the composition of your text on the InDesign pages.
So have a backup at hand to revert to your original document.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thank you, this is a good solution but it ruins the composition.
Is it possible to remove these without affecting the composition?
Copy link to clipboard
Copied
Don't think so. InDesign's composition is based on formatting of text. Mainly the used composer and the used hyphenation engine like Proximity, Hunspell or Duden. And that is reacting extremely to the applied language.
If your HTML is OK with no langauge applied why don't you revert the document after exporting to HTML?
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Interesting suggestion, so the idea is that we would remove all the language tags manually and then revert to the original condition.
Is this feasible for an InDesign file that has hundreds of Paragraph Styles that are unique?
Copy link to clipboard
Copied
Basically you could reach all text in your document with a GREP find action and format the result.
If you have tables in your document you perhaps need additional GREP runs, because a table special character can stop a result range prematurely.
Plus: One TEXT find action that reaches all the special characters that represent the tables in a text stream.
Suggested GREP search: Scope should be Document.
Include: Locked Layers, Hidden Layers, Master Pages and Footnotes.
This GREP would not be stopped by footnote markers, see the OR footnote marker in the pattern:
(?s).+|~F
Format the found characters with: Language [No Language]
Suggested TEXT search: Scope should be Document.
Include: Locked Layers, Hidden Layers, Master Pages and Footnotes.
<0016>
Format the found characters with: Language [No Language]
After that you'll get perhaps a lot of overset text. Don't worry much about that.
HTML export will also export the overset text. At least that's the result from a little test I did.
Documentation of InDesign's Find-Change feature:
https://helpx.adobe.com/indesign/using/find-change.html
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
This is a fantastic elegant solution. Thank you so much. It works perfectly.
Is there a reference guide to building regex pattern in InDesign or is it standard RegEx syntax?
Copy link to clipboard
Copied
There is a myriad of RegExp flavors. InDesign's GREP is just one of them. Plus special pattern for special cases like footnote markers etc.pp. Surprisingly there are also omissions like the special character for tables. Fortunately a TEXT find action can handle this.
You asked for sources. See into Jongware's GREP Help for InDesign:
http://www.jongware.com/idgrephelp.html
Also see into Peter Kahrel's GREP utilities that add a lot of value:
https://creativepro.com/files/kahrel/indesign/grep_matters.html
This book, also by Peter Kahrel, could be of interest as well:
Peter Kahrel: GREP in InDesign, 3rd Edition
https://indesignsecrets.com/now-available-grep-in-indesign-3rd-edition.php
And when we are at it, using InDesign's Scripting capabilities with ExtendScript together with RegExp ( slightly different to GREP ) plus InDesign's GREP by scripting could fill all the gaps that you might run into:
Peter Kahrel: JavaScript for InDesign
https://indesignsecrets.com/book-excerpt-javascript-for-indesign.php
Or, if you are able to understand German, read into this book with a strong GREP chapter:
Gregor Fellenz: InDesign automatisieren
https://www.indesignjs.de/auflage2/
Below a GREP Reference by the author ( in German ) to download as PDF:
https://www.indesignjs.de/GREP-Referenz__Gregor_Fellenz.pdf
An overview of that book in English by Marc Autret :
“InDesign automatisieren,” a Scripting Bible (in German)
http://www.indiscripts.com/post/2015/12/indesign-automatisieren-scripting-bible-in-german
Regards,
Uwe Laubender
( ACP )