Code Span as first word of paragraph extends to entire paragraph

When I use ‘Code Span’ style on the first word of a paragraph, and the rest of the paragraph in ‘No Style,’ it looks fine in the editor, but when compiled to ePub the entire paragraph is in ‘Code Span’ style.

This doesn’t happen when I use the ‘Non-Fiction Format.’ I have been using a modified format that provides 1.2.3 type numbering to sections and subsections. I have also edited paragraph indentation and line spacing. As best I can recall, I haven’t made any other changes.

I’m attaching a short .scriv file that illustrates the problem. The format ‘Ebook With Numbered Sections’ is included as a project format, so I believe this is enough to reproduce the problem.

Thanks in advance for looking at this. I realize that whatever I have done to expose this bug is probably very uncommon.
possible_bug.scriv.zip (290 KB)

Yes, it looks to be an even broader issue than the set of conditions you used to trigger it. In my testing, any condition that will have the conversion engine handling fixed-width fonts as the first word in a paragraph will cause the entire paragraph to be formatted with that font. Here are two examples, one using dedicated code spans, and the other faking it with formatting with styles:

[code]

Optional is a wrapper for objects…

Lorem ipsum dolor sit amet...[/code]

Thus the workaround is simple enough: change the Code Span style in your compile settings to use Helvetica or something. It doesn’t really matter, because in the end, as you can see, it’s going to become a span anyway. Here is the output using the same setup with both test styles changed to Helvetica:

[code]

Optional is a wrapper for objects…

Lorem ipsum dolor sit amet...[/code]

And if you’re wondering, you can clean this output up even further by using global paragraph formatting (established in the CSS pane) rather than Layout-specific custom formatting. If I apply your formatting to the global settings, and set Level 2 to use that instead, I get ideal output:

[code]

Optional is a wrapper for objects…

Lorem ipsum dolor sit amet...[/code]

Of course, if you actually need different kinds of body paragraph formatting depending on Layout, then ideals must be put aside.

Thanks for the report!

Thank you for checking this out for me, and especially, thanks for the workaround.

It took me awhile to figure out how to use global paragraph formatting, but I do like the result. Thank you yet again for the bonus info!

–Dave Matuszek