$SRC_ANCHOR in HTML and EPUB compiles

da
dayofthedave
Posts: 26
Joined: Wed Jan 18, 2012 12:56 am
Platform: Mac + Windows

Sun Sep 16, 2018 2:18 am Post

I just updated from Scrivener 2 to Scrivener 3, and I imported all my compile presets.

For my HTML and EPUB presets, all of my sections now have code like this near the top:

Code: Select all

{$SCR_ANCHOR::doc1$END_SCR_ANCHOR}


And to make matters worse, my heading font does not include curly braces, which wind up getting wrapped in span tags, like this:

Code: Select all

<p class="p1"><span class="s1">{</span><span class="s2">$SCR_ANCHOR::doc1$END_SCR_ANCHOR</span><span class="s1">}</span><span class="s2">Hello, world!</span></p>


So fixing this with search/replace is no easy task.

Jo
JoRo
Posts: 453
Joined: Sat May 26, 2018 6:40 am
Platform: Mac

Sun Sep 16, 2018 8:43 am Post

If you compile with the built-in HTML and ePub formats, do you get the same results?

Slàinte mhòr.

da
dayofthedave
Posts: 26
Joined: Wed Jan 18, 2012 12:56 am
Platform: Mac + Windows

Mon Oct 01, 2018 6:47 pm Post

Thanks for the response! I forgot to check the notify option, so I didn't realize this thread had a reply.

I found a workaround for my HTML format: uncheck "Convert document links to HTML links" in compile Options (under the gear icon). I do have a TOC that links to each chapter, but the HTML version of my e-book doesn't really need this feature, so it's OK to uncheck this box.

Unfortunately this workaround does not work for my EPUB format, presumably because the compiler still needs to create anchor points for the EPUB's built-in TOC.

The problem does seem to occur when the font being used at an anchor point does not happen to include curly braces in its character set. Would it be possible to change the temporary markup Scrivener creates for this particular feature to use a more common character, like a colon?

Code: Select all

:$SCR_ANCHOR::doc1$END_SCR_ANCHOR:

User avatar
KB
Site Admin
Posts: 20352
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Tue Oct 02, 2018 11:40 am Post

Hi,

I've looked into this and it actually has nothing to do with fonts (which don't affect the underlying text). The problem is that your RegEx replacements are interfering with the internal tags that Scrivener uses for anchors during the Compile progress, mangling them so that they are no longer recognised at the other end of the process. I've fixed this for the next update, but in the meantime you can work around it if it's possible to tweak your RegEx replacements.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

da
dayofthedave
Posts: 26
Joined: Wed Jan 18, 2012 12:56 am
Platform: Mac + Windows

Tue Oct 02, 2018 12:50 pm Post

Thanks for all your help!