pollen-users icon indicating copy to clipboard operation
pollen-users copied to clipboard

How do I change the smart-quote behavior in Pollen Markdown?

Open kolstadmagnus opened this issue 4 years ago • 3 comments

I assume I have to adjust this parser in a similar manner to what’s explained here.

For Markup documents, I really struggled with actually finding the Typography module so I could edit it, so I ended up just copying the relevant code from the Pollen GitHub repository and pasting it in my own work environment, and then changing it there. This works fine.

Is a similar approach possible for Markdown and its parser? If it’s not, then what do I do?

kolstadmagnus avatar May 21 '21 17:05 kolstadmagnus

really struggled with actually finding the Typography module so I could edit it

In DrRacket, right-click on a function and select “Open Defining File”

Is a similar approach possible for Markdown and its parser?

I didn’t write the Markdown parser, so I don’t know much about how it works. Though in general, if you don’t like its output, you may find it easier to put the parse tree through a second round of processing, rather than try to hack on the underlying parser.

mbutterick avatar May 22 '21 01:05 mbutterick

In DrRacket, right-click on a function and select “Open Defining File”

I see. Thanks!

you may find it easier to put the parse tree through a second round of processing, rather than try to hack on the underlying parser.

That sounds like a smart idea, but I don’t have anywhere near the skills unfortunately.

I’ve looked over the parser, and think I know how to alter it to behave like I want. But how do I locate the underlying parser stored as it is on my computer? I assume it’s a similar approach as with locating the Typography module, since the parser is a part of the Pollen package?

kolstadmagnus avatar May 26 '21 21:05 kolstadmagnus

the parser is a part of the Pollen package

Yes, in a sense. The Markdown parser is a separate package that is imported by Pollen.

That sounds like a smart idea, but I don’t have anywhere near the skills unfortunately.

You can achieve your goal by writing a suitable root tag function in your Pollen project. You don’t need to hack the underlying Markdown parser.

mbutterick avatar May 26 '21 23:05 mbutterick