GithubHelp home page GithubHelp logo

urls.wwwMatches usecase about autolinker.js HOT 4 CLOSED

filipagh avatar filipagh commented on July 24, 2024
urls.wwwMatches usecase

from autolinker.js.

Comments (4)

gregjacobs avatar gregjacobs commented on July 24, 2024

Hey @filipagh. I'd like to understand a bit more. If you don't want to link example.com then set tldMatches to false (which you have), and if you want to link http://google.com you set schemeMatches to true (which you also have).

However, with schemeMatches: true, a URL like http://www.google.com would have linked in v3.16.2 even if wwwMatches was set to false. The wwwMatches option only applied for non-scheme matches.

Are you saying that you have a use case to link www.google.com but not google.com (both scheme-less?)

from autolinker.js.

filipagh avatar filipagh commented on July 24, 2024

yes we want link url if it has scheme or has www. on start else leave it as it is

so in same text

[scheme://]www.google.com
scheme://google.com

should be linked
and google.com should not

from autolinker.js.

gregjacobs avatar gregjacobs commented on July 24, 2024

Ah, and just so I understand fully: why wouldn't you want google.com linked in this case?

from autolinker.js.

filipagh avatar filipagh commented on July 24, 2024

main reason was that we did not want to parse links in form like google.com, but we reconsider it and we will parse all valid links

second use case is in mail template
and we do not want link text with that format
like tenant can have its domain name in template which can be like example.com which is link but not mean to be parsed as link

so use case is to switch mail template format from plain text to html and back
and we expect that plain to html to plain will not change original content

so in this case we want to link only schema / www links where we are sure its link

now this is solved by altering custom html to text formater


so no more need for urls.wwwMatches for us

from autolinker.js.

Related Issues (20)

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.