m1l / Everything-Metric

Edge (Chromium) and Chrome Extension for converting USCS sites to Metric / SI
62 stars 15 forks source link

Disable for code #12

Open redfast00 opened 3 years ago

redfast00 commented 3 years ago

When I read code, numbers in quotes like inp = '653427918'​ get converted to inp = '653427918'​【199 165 km】. I don't know how easy it is, but I think it would be nice to have an option to turn off the converter for monospace text.

m1l commented 3 years ago

hmm, I'll check if there is way to check if it is monospace, but it already ignores <code> tag so it doesn't convert the number in your message above. Is there another tag where that code is wrapped into? Can you show me the page where it happens?

redfast00 commented 3 years ago

Sure: https://gist.github.com/redfast00/6b462037e57f33c850987242c34fd91d

I don't know if it's possible to detect that text is displayed in a monospace font and to decide to convert units based on that.

redfast00 commented 3 years ago

Additional example: https://github.com/pyauth/pyotp#time-based-otps