is now part of CreativePro.com!

InQuestion: Removing Unwanted Text Anchors

8
InDesign Magazine Issue 111: Treasures From the Vaults
This article appeared in Issue 111 of InDesign Magazine.

Jamie McKee identifies a strange hidden character, tells where it came from, and how to get rid of it easily.

Q: I’m setting chapters for a book that contains endnotes. My Word documents are properly styled, but when I place them into my InDesign template, they’re filled with hidden characters—always at the start of the text and usually before each endnote callout. I want my InDesign files error-free and these characters make me nervous. Any idea what they are and how to get rid of them?

A: Kudos to you for wanting your files clean and error-free—I wish more people worked that way! I’ve set quite a few Word documents as you describe and have run across this very issue.

. . . .

This article is for members only. To continue reading, please sign in, or sign up for a membership today. Thanks for supporting CreativePro!

BECOME A MEMBER

CreativePro membership keeps you up-to-date with the technology, solutions, and resources to strengthen your professional development.

For just $6.50/month (billed annually), you’ll get access to valuable benefits, including:

  • 12 monthly issues of CreativePro Magazine, filled with practical, real-world tutorials written by experts
  • Downloadable resources including templates, fonts, scripts, design assets, cheat sheets, and more
  • Hundreds of members-only tutorial and tip articles
  • Top Tips for InDesign, Photoshop, and Illustrator ebook collection
  • Discounts on events and books
  • and more...

Sign up now!


Jamie McKee is a book designer and typesetter for university presses throughout the US. More information about him can be found at mackeycomposition.com.
  • Rilk says:

    Hi, my friend, to fix this problem use notepad of Windows.
    How to do:
    First of all, copy your text to notepad (bloco de notas em português do Brasil).
    Now select the text from notepad and copy it.
    Now you can paste into Word or InDesign without this signals.
    The notepad eliminate all off these crazy hiden signals :)

    Ps.: if I wrote wrong, very hard mistake with the English language, tell me and I’ll try explain better :)

  • Mikael Johnsson says:

    I ran in to something similar a few years back. Unwanted hidden characters in imported word files. They looked like blue colons when i viewed the hidden characters.

    I read in a forum that you can search and replace these empty anchors by looking for in the search dialog box. Don’t know what that refers to – but that solution worked for me back then, and I’ve used it a couple of times since then.

    • Mikael Johnsson says:

      I noticed that my comment removed the string i searched for:

      FEFF contained in chevron brackets.

  • Tamás Nagy says:

    I found another type of these Text Anchor-like things: this type of hidden colon is always at the very beginning of some paragraphs, but there are no hyperlinks or bookmarks in the document at all.

    I can select this colon, and I can even paste it into the find what fields of both the text search and the grep search windows (^I or ~I appears there, as if it was a Text Anchor), but the search process results in no match. When I try the unicode value directly in the text search the result is the same: nothing.

    When I look at it in the Story Editor nothing can be seen there but the cursor can step over this nothing so at the beginning of the paragraph text I have to press right button twice to go over the first real letter of it.

    So it looks like we have no help, we have to remove these annoying “nothings” manually. This hidden character is very much in our way when scripting, since it is sometimes counted into the paragraph length, sometimes not, and it can cause a 1 character shift in text processing: the script result is often unusable.

    Fortunately I could figure out a scripted solution that removes this thing from the beginning of the paragraphs. Assuming that variable P points to a paragraph here is the line of code that does the job:

    if (P.contents.charCodeAt(0)==65279) P.characters[0].remove();

    It checks the same value but somehow this way InDesign behaves like a good boy and removes that badass character.

    • Tamás Nagy says:

      As in the previous post the unicode values disappeared. It was FEFF again.

      • Tamás Nagy says:

        Update: these vicious nothings may appear anywhere in the paragraph. So I modified the code to manage the inter-paragraph nothings as well (I hope the pre tag will work):


        pos=P.contents.indexOf("\uFEFF");
        while (P.contents.length>0 && pos>-1) {
        P.characters[pos].remove();
        pos=P.contents.indexOf("\uFEFF");
        };

      • David Blatner says:

        Tamás: Unfortunately code and pre work in our forums, but not in comments… I fixed it for you here.

        However, it is important to note that if you delete all the FEFF, you may delete more than you expected. InDesign uses that code for several important things. See: https://creativepro.com/topic/unknown-character/#post-111365

  • Tamás Nagy says:

    Thank you very much for the warning, David! You’re right, this code can badly ruin things. Fortunately, we don’t use those bookmarks or other types of links in our printed books at all, but they often make our job more complicated. So for us killing all of them by a script is like a lifebelt. We always delete all xml contents as well, together with all the labels.

  • >
    Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo