custom CSS not applying

john laudun's Avatar

john laudun

13 Jan, 2023 06:13 PM

// Please enter a detailed description of the issue // Description of the issue:

Marked is not fully loading, or recognizing, a custom style sheet when I "apply" it to a document. In particular, it is not recognizing a change in type face and is simply using the default (Times?). If I delete the custom style sheet from the preferences tab for doing so and then add it back, it works again. If I quit Marked and come back ... the cycle repeats.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 1040 (Mac App Store)

macOS Version: 13.1

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: YES
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: swiss
defaultProcessor: MultiMarkdown
enableMiniMap: YES
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: NO
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft: LAUDUN - %title
printHeaderTopRight: %page
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

  1. 1 Posted by Mark Hedges on 13 Jan, 2023 08:01 PM

    Mark Hedges's Avatar

    Second this. Styles don't work.

  2. 2 Posted by john laudun on 13 Jan, 2023 08:25 PM

    john laudun's Avatar

    Okay, so I didn't know this went into a discussion forum. But, second, I came across the page on Creating Custom Styles (https://marked2app.com/help/Writing_Custom_CSS.html), and I'm taking a look at it now to see if perhaps having the CSS structured in a particular way will get things working.

  3. Support Staff 3 Posted by Brett on 13 Jan, 2023 08:58 PM

    Brett's Avatar

    Would either of the users on this thread care to share their custom style so I can see if there are any errors that might be affecting this? I use custom styles every day and never have an issue.

  4. 4 Posted by Mark Hedges on 17 Jan, 2023 02:54 PM

    Mark Hedges's Avatar

    Any style that I pick in the preferences. It doesn't apply. The default style is stuck. This was a fresh installation of the program. Maybe you have some kind of preference file from an old version that the new version didn't create or created incorrectly.

  5. 5 Posted by john on 23 Jan, 2023 05:56 PM

    john's Avatar

    Here's the custom style sheet.

  6. Support Staff 6 Posted by Brett on 23 Jan, 2023 07:35 PM

    Brett's Avatar

    @john style looks fine. I'm going to have to recommend that you delete preferences and reboot to see if that solves the issue.

    To delete your preferences with the MAS version of Marked 2:

    1. Quit Marked 2
    2. Delete the file at ~/Library/Containers/com.brettterpstra.marked2/Data/Library/Preferences/com.brettterpstra.marked2.plist (and any other files starting with com.brettterpstra.marked2). If you're not sure how to access this folder, open Finder and press ⌘⇧G, then paste "~/Library/Containers/com.brettterpstra.marked2/Data/Library/Preferences/" (without quotes) into the box.
    3. Reboot the computer (this is important as macOS aggressively caches preferences and may just restore the deleted file without your knowledge.
    4. Launch Marked 2

    The directions for doing this with the direct version are the same, but the preference file is located in ~/Library/Preferences.

  7. 7 Posted by rob78293 on 12 Jul, 2024 03:09 PM

    rob78293's Avatar

    @brett I'm having problems with this too. I've tried deleting that preference file and it didn't help.

    Relaunching the app seems to "forget" the styles. It could be something to do with permissions?

    1. Add css file (from Git repo) to the styles list
    2. Close preferences, it asks for access to folder (that the css file was in)
    3. Select the style in the Marked window dropdown
    4. Close Marked
    5. Styles are disappeared and some default serif font displays
    6. Remove css file from the styles list in preferences
    7. Add the css file again to the preference list
    8. This time it doesn't ask for access to the folder
    9. Step 3 again. Works.

    I don't think it has anything to do with the CSS file itself, but I've added it anyway. It's in a local Git repo.

  8. Support Staff 8 Posted by Brett on 12 Jul, 2024 03:41 PM

    Brett's Avatar

    I'm headed off to a conference this weekend, but will schedule this to look into next week. Sorry for the delayed response.

    -Brett

    On 12 Jul 2024, at 10:09, rob78293 wrote:

  9. Support Staff 9 Posted by Brett on 16 Jul, 2024 07:09 PM

    Brett's Avatar

    @rob78293, I tested with your CSS file and was unable to replicate the issue. Can you do two things for me?

    1. Post the output of Help->Report an Issue in a reply here.
    2. Possible to record a screencast of the above happening, just for clarity? After relaunching and losing styles, please be sure to show me the contents of the dropdown.

    When the serif font (missing stylesheet) version is displaying, does ⌘R restore the default style? And at that point what style is showing in the dropdown?

  10. 10 Posted by rob78293 on 19 Jul, 2024 10:23 PM

    rob78293's Avatar

    // Please enter a detailed description of the issue // Description of the issue:

    Launching loses formatting for custom css (and opens with default style). Pressing refresh (⌘R) does indeed solve the problem. I've attached a video link but it expires in 2 days!

    // Please enter a list of steps required to reproduce the issue // Steps to reproduce:

    1. Add and select custom CSS file
    2. Close down Marked App
    3. Relaunch and re-select custom CSS file

    // If applicable please attach a sample document that causes the issue for you.

    Video here: https://streamable.com/4jfl12 — I don't want to upload it on this forum as it's CV type stuff ;)

    // Configuration (do not edit) Marked 2 1058 (Mac App Store)

    macOS Version: 12.7.5

    additionalMathJaxConfig:
    allowPageBreakInCode: YES
    bookTxtIsLeanpub: NO
    summaryMdIsGitBook: NO
    codeIsPoetry: NO
    codeCanWrap: YES
    collapsibleHeadlines: NO
    convertGithubCheckboxes: YES
    convertGithubEmoji: YES
    convertYAMLToMMD: NO
    defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
    defaultPreviewStyle: 0
    defaultProcessor: MultiMarkdown
    enableMiniMap: NO
    excludeBlockQuotesFromCounts: NO
    excludeFootnotesFromCounts: NO
    excludeVerbatimFromCounts: NO
    excludeCaptionsFromCounts: NO
    folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
    githubNewlines: YES
    h1IsPageBreak: NO
    h2IsPageBreak: NO
    hrIsPageBreak: NO
    includeMathJax: NO
    includeKatex: NO
    limitTextWidth: NO
    mathNumberEquations: NO
    mathNumberEquationsSide: 0
    mathNumberEquationsAMSOnly: NO
    minimalJavaScript: NO
    outlineModeExtensions:
    permissionGranted: NO
    printHeaderBottomLeft:
    printHeaderBottomRight:
    printHeaderFirstPage: NO
    printFooterFirstPage: NO
    printHeaderTopLeft:
    printHeaderTopRight:
    processHTMLFiles: YES
    removeMetadataForPreview: NO
    removeYAMLHeaders: NO
    scrollToEdit: YES
    shouldDetectCritic: YES
    shouldHighlightMarkupErrors: NO
    shouldLoadCritic: NO
    syntaxHighlight: YES
    syntaxHighlightOnlyLang: NO
    useCustomMarkdownProcessor: NO
    customMarkdownProcessor:
    useCustomPreprocessor: NO
    customPreprocessor:
    useFirstH1AsPrintTitle: YES

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