replace all soft hyphens with non-breaking hyphens?
June 28, 2022 12:00 AM
Is there a way to do a global search & replace in the .awt file to replace all soft hyphens with a non-breaking hyphen?
I'm editing a French module where the text was likely copied and pasted from a Word document. Many of the hyphenated words (ci-dessous, est-il, etc) turned up with a soft hyphen and I'm finding myself fixing them one at a time. It would be a HUGE time saver if I could just do it all in one sweep.
I tried just doing it in Notepad++ but it didn't seem to work. Maybe there's a regex solution?
Discussion (2)
Hello Susan @susanmacnab . Editing the AWT file manually to replace the en-dash and em-dash is possible, you just have to be careful and use an editor that supports the various special characters that Word creates. The soft dash might be the tip of the iceberg, as you might also have another dozen special characters like an ellipsis, smart quotes, smart double quotes, etc.
As an employee of ELB Learning, I would not recommend directly editing the AWT file since you can corrupt your entire course by breaking the XML syntax the AWT file uses. There is no universal tool to repair a corrupt AWT file since there are thousands of ways to corrupt the file when using a text editor.
That being said, I outline a process below that will work for you, using Lectora's Find/Replace function. This will not mess with the syntax or structure of the AWT file and should be safe in any version of Lectora.
I use this excellent article that you can open in your browser with no need to own Microsoft Word. The article explains the characters that Word creates and is also an excellent article to send to your SMEs and content creators as examples of characters to not use, or to show why they should not copy and paste from Microsoft Word.
https://erinwrightwriting.com/special-characters-microsoft-word/#:~:text=9%E2%80%9312.,open%20and%20close%20a%20quotation.
Usually focusing on the section "Special text Characters" 1-12 is sufficient. However, I also look for bullets (·)
1. Within Lectora, back up your whole course to a safe place using FILE -> EXPORT -> ZIP or -> Lectora Online Package.
2. Open your course in Lectora
3. Open a browser to the article linked above showing the list of special characters.
4. In Lectora, on the HOME menu, click on the "Replace" link in the Edit section of the ribbon bar over to the far right
5. I then use Find/Replace for each special character and replace them with the keyboard character.
undefinedb. Replace with: On your keyboard, type the character you want to replace the special character with.
6. You can replace them one at a time using the "Replace" button until you feel comfortable with the process. Use "Replace All" once you feel comfortable with the process.
7. Lectora will report in a popup window how many replacements were made.
Hope this helps. Just remember, if you don't follow the above process and edit the AWT file in a text editor, you can break the AWT file. Once this file is broken, the whole course is now "corrupt" and is not repairable unless you get lucky and find what you did wrong. Not an easy task.
BACKUP YOUR COURSES BEFORE ATTEMPTING!
Thank you @jholland for your fast response.
I appreciate your concern over editing the .awt directly. I assure you I did make a backup first and I only edited the text fields that appear on the screen. It didn't work anyways, LOL! I wound up just manually changing each of the hyphens in Lectora desktop.
It's a little frustrating because the hyphens appear as normal in the editor (L21 desktop) but you don't notice that they're missing until you view in a browser.
Also - that's a great article that you shared on special characters. Will definitely be bookmarking for future use and sharing any change I get!