Comments (5)
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?
from prettier-browser-extension.
Yes, when you clicking on the Prettier button from the toolbar, and if the focus is inside a textarea
it should probably format it.
from prettier-browser-extension.
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.
from prettier-browser-extension.
Ohhh I like that idea :)
from prettier-browser-extension.
Some resources for language detection:
- https://prettier.io/docs/en/api.html#prettiergetsupportinfo-version
- https://highlightjs.readthedocs.io/en/latest/api.html#highlightauto-value-languagesubset
- https://www.npmjs.com/package/language-map
- https://www.npmjs.com/package/language-detect
from prettier-browser-extension.
Related Issues (20)
- Feature request: ability to format code files hosted on github HOT 9
- Add isRequired to prop types
- Support GitHub Wiki pages!
- Unable to load unpacked extension after development build HOT 3
- Fields should have labels including field titles and checkbox descriptions
- Options link in extension options has broken link HOT 3
- Add screenshot(s) to `README.md` showing usage HOT 5
- Add instructions for setting options to `README.md` HOT 2
- Safari support for macOS Big Sur
- Code formatting on working on GitHub HOT 1
- Change default branch to main HOT 6
- Rethink approach HOT 8
- Consider adding more web-ext scripts
- Stack Overflow code snippets are not formatted
- formatting errors for generics when `lang-tsx` is selected
- Publish to firefox addons AMO store
- How to use it? HOT 1
- Support Stack Exchange sites other than Stack Overflow
- Prettier button appears where it shouldn't on GitHub
- Upgrade to Prettier 1.19 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-browser-extension.