Extending Markdown syntax in BBEdit

950 views
Skip to first unread message

zverhope

unread,
Sep 7, 2018, 9:12:59 AM9/7/18
to BBEdit Talk
Hi all,

I've spent the last little while looking for a new text editor and have most recently been familiarizing myself with BBEdit. It's a great piece of software that's so much faster on my Mac than, say, Atom, and I'd love to stick with it. The one thing I can't seem to figure out, however, is how to best extend the Markdown support. Well, I suppose I have figured out some of it: I have scripts, clippings, etc. that allow me to effectively produce the syntax and export documents via Pandoc, but what I can't seem to do is extend the highlighting to recognize the syntax for anything beyond the basic built-in Markdown (headings, italics, links, etc.). As an academic, things like syntax highlighting for Pandoc citations, footnotes, preferably Critic Markup (although less necessary), as well as a few other things, are quite important, but I can't seem to figure out how to accomplish these kinds of extensions. And I've Googled to no avail. Does anyone know whether they have been or are possible in BBEdit?

Thanks so much to you all for your help!

Jan Erik Moström

unread,
Sep 7, 2018, 9:14:38 AM9/7/18
to BBEdit Talk
On 7 Sep 2018, at 8:35, zverhope wrote:

> Does anyone know whether
> they have been or are possible in BBEdit?

I think that you need to write a custom language module (I've never done
that so I don't know how complex that is)

= jem

Stephen Lien

unread,
Sep 11, 2018, 11:43:14 AM9/11/18
to BBEdit Talk
I hate to be negative, but wait until you try to write LaTeX equations in your markdown documents.  Personally I find it annoying the way the syntax highlighting gets confused with _ for subscripts.

I wrote to support and the response was basically, LaTeX equations are not part of the formal markdown spec.  True, but many people rely on them in their documents.  Github, Pandoc, etc...

I think the accepted standard is that anything between dollar signs is considered an equation as long as there are no spaces after the left dollar sign and no spaces before the right dollar sign and no digits after the left dollar sign.  

I think you are on your own for anything more complex than the basic syntax included.

I wish the syntax that is included in BBEdit was open via Github so users can help extend and the BBedit people could approve or not the pull requests.

@lbutlr

unread,
Sep 12, 2018, 3:26:32 AM9/12/18
to BBEdit Talk
On 11 Sep 2018, at 09:42, Stephen Lien <sl2b...@gmail.com> wrote:
> I hate to be negative, but wait until you try to write LaTeX equations in your markdown documents. Personally I find it annoying the way the syntax highlighting gets confused with _ for subscripts.
>
> I wrote to support and the response was basically, LaTeX equations are not part of the formal markdown spec. True, but many people rely on them in their documents. Github, Pandoc, etc...
>
> I think the accepted standard is that anything between dollar signs is considered an equation as long as there are no spaces after the left dollar sign and no spaces before the right dollar sign and no digits after the left dollar sign.
>
> I think you are on your own for anything more complex than the basic syntax included.
>
> I wish the syntax that is included in BBEdit was open via Github so users can help extend and the BBedit people could approve or not the pull requests.

There are a lot of variation on MarkDown, but John has been steadfast in his belief that MarkDown is exactly what it was intended to be, and BBEdit uses the version John publishes.

<https://daringfireball.net/projects/markdown/syntax>
> PHILOSOPHY
>
> Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
>
> Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters — including Setext, atx, Textile, reStructuredText, Grutatext, and EtText — the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.
>
> To this end, Markdown’s syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like *emphasis*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you’ve ever used email.


You might not agree, but I would say that embedded LaTeX does not fit that philosophy (and I'm a fan of LaTeX).

--
"He is a self-made man and worships his creator." - John Bright

Stephen Lien

unread,
Sep 12, 2018, 9:01:58 AM9/12/18
to BBEdit Talk
I guess if that is the philosophy that BBEdit goes by, then we have to either deal with it or look elsewhere.  Kinda sad that this is the state. One can view this as an excuse for not keeping up with the where markdown as moved to. Yes the original doesn't have all these extensions, but I think a lot of markdown software try to accommodate how markdown has evolved.

Patrick Woolsey

unread,
Sep 12, 2018, 9:27:59 AM9/12/18
to bbe...@googlegroups.com
On 9/12/18 at 3:26 AM, kre...@kreme.com (@lbutlr) wrote:

>[...], and BBEdit uses the version [of Markdown that] John publishes.
>
><https://daringfireball.net/projects/markdown/syntax>


I'm sorry but that is not correct: BBEdit 12 uses CommonMark
<https://commonmark.org/> as its native Markdown renderer, or
you can employ its _preview filter_ capability to use any
alternate renderer (such as MultiMarkdown).

For details on how to do this, please see the "Applying Preview
Filters" section in chapter 11 of the PDF manual (available via
Help -> User Manual).

[NB: Please note that using an alternate renderer affects how
your documents display but does not change their syntax coloring.]


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com/>



Patrick Woolsey

unread,
Sep 12, 2018, 9:54:45 AM9/12/18
to bbe...@googlegroups.com
On 9/12/18 at 8:44 AM, sl2b...@gmail.com (Stephen Lien) wrote:

>On 9/12/18 at 3:26 AM, kre...@kreme.com (@lbutlr) wrote:
>> There are a lot of variation on MarkDown, but John has been steadfast in his belief that MarkDown is exactly what it was intended to be, [...]
>>
>I guess if that is the philosophy that BBEdit goes by, then we
>have to either deal with it or look elsewhere. Kinda sad that
>this is the state.
[...]

The preceding may still reflect John Gruber's expectations for
Markdown (or perhaps not; I haven't asked him myself :-).

That is however _not_ the philosophy by which we develop BBEdit;
rather, we have evolved BBEdit's capabilities for over 25 years
now, and will contine doing so. :-)

Christopher Finazzo

unread,
Sep 12, 2018, 10:39:12 AM9/12/18
to BBEdit Talk
The closest derivative I can think of would be Multimarkdown, which extends Markdown to do a few of the things you described.


On Friday, September 7, 2018 at 9:12:59 AM UTC-4, zverhope wrote:

Stephen Lien

unread,
Sep 12, 2018, 10:39:12 AM9/12/18
to BBEdit Talk
I should of been clear, that comment was meant strictly about the markdown.  The work and evolution of BBEdit really has been great.

In all sincerity, I look at BBEdit as an editor that I can trust.  That means a lot.   I don't have the time for crashes and losing work.  I like stability and long term support. That is why I am passionate about wanting to use BBEdit for everything when I need to write text based stuff.  I think the straight up LaTeX support is great.  I look at other editors with their crazy color schemes or rediculous amount of extra chrome/distractions and I look at BBEdit and think this is perfect.  Looking for the same experience for markdown for me.  I'm sure even if we were to get this support, there will be the next person asking for support for tables or so other extension beyond LaTeX.

@lbutlr

unread,
Sep 13, 2018, 1:26:45 AM9/13/18
to BBEdit Talk
On 12 Sep 2018, at 06:44, Stephen Lien <sl2b...@gmail.com> wrote:
>
> I guess if that is the philosophy that BBEdit goes by,

That was John Griner. the author of Markdown, not BBEdit.

> then we have to either deal with it or look elsewhere. Kinda sad that this is the state. One can view this as an excuse for not keeping up with the where markdown as moved to. Yes the original doesn't have all these extensions, but I think a lot of markdown software try to accommodate how markdown has evolved.

Markdown has NOT evolved. John Gruber wrote Markdown, his spec is the only spec for Markdown. Many people have made forks, and (annoyingly) many of these people call their custom flavor/branch/variant Markdown, but anything that is not to John's spec is not Markdown, it's something else.

It'd be a bit like if you made a fork of gcc and called it gcc, to you own fork of vi and instead of naming it "vim" you just named it vi.

--
How do I set my laser printer to "STUN"?

@lbutlr

unread,
Sep 13, 2018, 1:27:42 AM9/13/18
to BBEdit Talk
On 12 Sep 2018, at 23:26, @lbutlr <kre...@kreme.com> wrote:
> That was John Griner.

REALLY autocorrect, REALLY?

John Gruber.

--
I'm not old, I'm chronologically challenged.

@lbutlr

unread,
Sep 13, 2018, 1:28:48 AM9/13/18
to BBEdit Talk
On 12 Sep 2018, at 07:27, Patrick Woolsey <pwoo...@barebones.com> wrote:
> I'm sorry but that is not correct: BBEdit 12 uses CommonMark <https://commonmark.org/> as its native Markdown renderer, or you can employ its _preview filter_ capability to use any alternate renderer (such as MultiMarkdown).

Thank you for the correction, I honestly had no idea!

--
"He has never been known to use a word that might send a reader to the
dictionary." - William Faulkner (about Ernest Hemingway).

Reply all
Reply to author
Forward
0 new messages