Giter Club home page Giter Club logo

i-m-a-converter's People

Contributors

limmlingg avatar

Watchers

 avatar

i-m-a-converter's Issues

Feet and Inches not detecting/converting numbers correctly

In the feet and inches test page, the title and highlight of the last measurement of 123'53" shows 123' only.

When I console.log() the regex matches in conversion.js: extractFeetAndInchesNum(str), both 123 and 53 are detected. The conversion is also for 123'53".

This is likely caused by addFeetAndInchesTitles() incorrectly calling setTitle() in conversion.js. Should be an easy fix.

HTML replace duplicates and has weird titles

Noticeable on sites like https://www.metric-conversions.org/temperature/fahrenheit-to-celsius.htm.
Can also be observed in the feet and inches test page.

When looking at the modified HTML, you can see that the title takes on a weird value:
title="<strange number carried over from somewhere> <f2ctag style="..........

When I console.log the title in the method, it gives me what I expect i.e. 212°F = 100°C. Maybe something is wrong with my innerHTML.replace()? We might need to explore using a different method to do conversion.js: setTitle().

Cannot replace HTML on sites where there is some HTML between the number and the unit

For example: https://en.wikipedia.org/wiki/Fahrenheit, and a Google search for "fahrenheit".

Based on the console.log output, the extension successfully detects the temperatures and converts them. The issue is very likely because of the HTML between the number and the unit, so innerHTML.replace() doesn't work.

For instance, on Wikipedia, the temperature 32 °F is written as 32&nbsp;°F in HTML.
On Google, some site descriptions have the number in bold, but not the unit, or vice versa.

This issue will likely require major refactoring.

No Automatic Updates

When a page updates, e.g. the user types in 10 °F into the Google search bar, the unit translator should detect it and convert it too.

An easy way is to call addTemperatureTitles() again when the browser detects that the page changed. However, this will probably cause issues for existing conversions as the <f2c> tag will be applied twice to the same part in the HTML because of the innerHTML.replace() in setTitles().

This issue likely requires some rewriting of setTitles() or an extra step during parsing to check if the temperature already has the <f2c> tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.