Closed nizniz187 closed 2 years ago
How about this issue? Is it matter now?
I will implement it next.
Added an attribute lang
for user to assign language manually. If this attribute is not set or set to empty, then an auto detection will be applied.
For example, this code is highlighted as HTML below in auto detection mode:
But if we assign the lang
attribute to javascript
, it would look slightly different:
For the initial problem this issue was intending to solve, the npm script looked like this in auto detection (obviously wrong):
Now it should be assigned correctly as lang='shell'
:
which looks simply nothing highlighted, but is actually highlighted as designed (see the official demo code below.)
In this situation, add a $
sign in the front could make it look better :p
@cwpeng Please help review.
looks good.
Auto-detecting is not always correct. For example,
npm install
is not detecting correctly. That's why we need a property to let user assign the language.