tocstyle.css causes issues with Fontawesome when used in document

dan's Avatar

dan

10 Aug, 2021 07:10 AM

Hi,

I've been pulling my hair out on this one and have lost a whole day's work (I regret nothing!!),

I was trying to use Font Awesome in some custom styled documents. Unfortunately, Marked uses Font Awesome in the creation of Tables of Content (I didn't think to check that for a long time) and the Font Awesome css in tocstyle is causes issues with stacked icons.

The plain HTML copy worked as expected, but generated HTML and PDFs did not.

For a quick fix, add

.fa-stack-2x { 
   font-size: 1em !important;
}
.fa-stack {
   width: 2.5em !important;
}
to your custom CSS.

May suggest changing the classes in TOC to not clash with the standards?

Also, an easy to turn the libraries that Marked uses on and off would be extremely great.

Dan

  1. Support Staff 1 Posted by Brett on 11 Aug, 2021 12:48 PM

    Brett's Avatar

    Turning libraries Marked uses for core functionality would be problematic. That said, the only reason marked has FontAwesome included at all was based on user requests. Stacking must be a new feature?

    Thanks,
    Brett

  2. 2 Posted by dan on 13 Aug, 2021 07:59 AM

    dan's Avatar

    Hi Brett,

    I'm not sure if it's new or not, but it appears hard coded in toc stylesheet.

    I've also run into a problem with the "Prevent orphaned headlines" option where Marked adds or ignores some css instructions when exporting to paginated PDF. Renders fine in the preview and HTML.

    The first image is with the option turned on.

    This is the css that gets ignored.

    H2 ~ H3 {
    padding-top: -6pt !important;
    }
    
  3. Support Staff 3 Posted by Brett on 13 Aug, 2021 12:23 PM

    Brett's Avatar

    When collapse headers is enabled, markup is injected to wrap around headers and their succeeding content. Therefore headers are no longer contiguous in the DOM because they're nested in separate parent containers.

    Thanks,
    Brett

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac