Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Apr 28, 2020 02:24 AM
When I retrieve the content of a rich text enabled long text field through the API, only “bold” formatting works. Strikethrough and Italic are retrieved with a whitespace before the markdown symbol and therefore are not parsed correctly.
Example:
Is retrieved like this:
You can see how 50 años posteriores shows up as _ 50 años posteriores_ instead of underscore50 años posterioresunderscore without spaces between the underscores and the thing I want to make italic.
Has anyone experienced this? Is there a way to fix it?
Solved! Go to Solution.
Apr 29, 2020 07:02 AM
I suspect that you are seeing a space between the underscore and the other characters that are italic because when the text was originally placed in italics, the space was also included as part of the italicized text. You don’t see the space as italicized because a space in italics looks exactly like a normal space.
I have tried formatting rich text as italic, bold, strike-through, etc., (both including and excluding surrounding spaces), and the Markdown source returned by the Scripting API exactly matches what I entered. Even though you are using the Standard API instead of the Scripting API, both APIs should return the same values.
Apr 29, 2020 07:02 AM
I suspect that you are seeing a space between the underscore and the other characters that are italic because when the text was originally placed in italics, the space was also included as part of the italicized text. You don’t see the space as italicized because a space in italics looks exactly like a normal space.
I have tried formatting rich text as italic, bold, strike-through, etc., (both including and excluding surrounding spaces), and the Markdown source returned by the Scripting API exactly matches what I entered. Even though you are using the Standard API instead of the Scripting API, both APIs should return the same values.
Apr 29, 2020 03:35 PM
This makes total sense, I checked and that’s what I think is going on there, but is this how Airtable should interpret it?
_ITALIC _ and ITALIC
Both should never be italic, so I think Airtable’s interpreter should remove leading and trailing whitespaces before placing the formatting symbols… right?
But if I go to my Rich text field and do this:
I get this:
Anyway, thanks for your help! :slightly_smiling_face:
Apr 29, 2020 04:38 PM
Can you give an example of a different text editor that automatically removes leading and trailing whitespace when applying text formatting as you suggest?
Apr 29, 2020 04:52 PM
Stackedit for example won’t let you format a trailing whitespace.
Also this html to markdown editor:
I guess the Standard API is not returning what it should.
Apr 29, 2020 05:28 PM
Thank you for the examples. Those examples seem to follow John Gruber markdown, which does not allow a trailing space between a word and a closing *
or _
.
But if you surround an
*
or_
with spaces, it’ll be treated as a literal asterisk or underscore.
Airtable uses a different version of Markdown. According to this support article …
Rich text in Airtable is based on on a variation of Markdown
Emphasis/bold is mine.
Hopefully Airtable will eventually support more Markdown features, including this change. However, it might be difficult for Airtable to implement this particular change without breaking existing rich text fields.
Apr 30, 2020 04:16 AM
Hopefully Airtable will eventually support more Markdown features, including this change.
I’ll be looking forward to that :slightly_smiling_face:
Thanks again for your time!