prettier / prettier-browser-extension

Prettier Browser Extension

Home Page:https://chrome.google.com/webstore/detail/prettier/fbcfnmplppajblbmdehballiekfgdkhp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic text box support

nickmccurdy opened this issue · comments

Other extensions like prettier-js-extension allow any text box to be used for formatting, which would help make this extension more useful with less code changes. I still think some of the functionality and UI specific to GitHub and Stack Overflow could be useful though.

commented

Yes, when you clicking on the Prettier button from the toolbar, and if the focus is inside a textarea it should probably format it.

Out of curiosity, how do we want to handle detecting the parser? Just naively assume it's Markdown? I wonder if the we could have a dropdown list when clicking the Prettier button in the toolbar that says Format as... and then has a list of langs we're supporting?

Good question, maybe we could use a language detection library and fall back to Markdown when it's unknown or looks like snippets from multiple languages.

Ohhh I like that idea :)