Jump to content

Escaping {} in blog posts

Recommended Posts

Hi there, I'm adding Latex equations to my blog posts using MathJax. It kinda works. 

I noticed that if I click "edit" and access the "edit post" window to make a change (eg update a tag) the post's text will be stripped of most of braces. For example \frac{num}{den} becomes \frac. This breaks my posts and forces me to painstakingly check each of them for errors every time I need to make an edit. Note that this problem exist even if you are not using Latex... all it takes is to have a work inside braces in a text block. Interestingly I have no problems if I edit the post by clicking the post's name -- without opening the "edit post" window.

I believe that the issue is due to JSON-T trying to render the text as if it were code.

Is there a way to escape the curly brackets or disable JSON-T render?

Link to comment
  • Replies 4
  • Created
  • Last Reply

Hi @fabrguer. Nice work on this. I can confirm this is an issue just as you describe. To summarize what I see:

  • Editing a blog post via the "edit" button (a.k.a., via the "dialogue text post editor" ("DTPE")) will result in the stripping of curly-brace-encapsulated-text ("CBET").
  • Editing a blog post within the context of the website (a.k.a., via the "yui3 text editor") will not strip the CBET.
  • The text will initially be saved and displayed properly on the website upon initial input. However, if the post is edited via the DTPE, the CBET will be stripped upon initialization of the block within the editor.
  • CBET will be stripped in text blocks whether the "code" format is used or not.
  • CBET will also be stripped in markdown blocks and code blocks (!)
  • Using HTML entity codes doesn't seem to help (`{` and `}`)
  • CBET will be preserved (not stripped) if the CBET contains a space that has a non-space character on both sides of it (not including the braces themselves)
  • All of the above bullets are applicable to any `text`-based collection item edited via the DTPE, but does not occur in the body of image-based collection items nor event-based collection items.
  • I personally have found no way to escape this behavior.

I would report this to Squarespace. You could provide a link to this post for more information.

If a response helped you out, send a 'Like' 👍 (bottom-right) and/or 'Upvote' vote.jpg.c260784ece77aec852b0e3049c77a607.jpg (top-left)

Link to comment
  • 2 weeks later...

I have the very same problem.  It sucks so bad.  Any workarounds?  Someone somewhere said something like {.meta-left} or something?

What's worse is that this was working perfectly when I first started my blog. Somewhere around Summer 2019 it broke.  I contacted SquareSpace and they blew me off, saying that debugging code injection isn't supported.  Classic.  I am fairly certain that a change they made to their editor is the problem.  Classic. 

Phil
mymathteacheristerrible.com

Link to comment
  • 3 months later...

See:

 

21 minutes ago, MollyCameron said:

Fixed an issue with blog posts where saving or duplicating a post that had text inside curly brackets caused the bracketed text to disappear. 

 

About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.