CDRH / african_poetics

Orchid / Rails site for Contemporary African Poets part of African Poetics site
0 stars 0 forks source link

DRY up parsing of Markdown #255

Closed wkdewey closed 1 year ago

wkdewey commented 1 year ago

Karin and Greg both suggested that it would be easier and cleaner to find a library to parse Markdown content from Airtable (for instance, for links), which we are currently parsing manually in the views.

techgique commented 1 year ago

I wouldn't suggest a gem in this case. With this minimal and simple of Markdown parsing I'd prefer not to. We want to avoid adding dependencies where possible because more dependencies means more supply chain security complexity and more chances for upstream gem changes to break our app. The simple code we have will be easier to maintain.

My preference is more that we just DRY up the code used to handle it. Write a method or two and centralize the regex pattern so it's not repeated across the code and we'll be golden. I think something in application_helper.rb might be the best approach so it's available app-wide. And if we expect it to be used in other sites, we can add it to Orchid. :+1:

techgique commented 1 year ago

Link to an instance of the code to DRY up later: https://github.com/CDRH/african_poetics/pull/251/files/577b4ca53586bceabd5470ea580ff3dc6bf22c96#diff-a66b553b0aacdddc02f84e8f7e527fcb9917ba9dd986e2b8ebe33e07aad3bbc5R19-R22