Giter Club home page Giter Club logo

Comments (7)

jordanlambrecht avatar jordanlambrecht commented on September 28, 2024 1

@coston am I a dick if I do linktext={'tel:911'}

from react-obfuscate.

jordanlambrecht avatar jordanlambrecht commented on September 28, 2024 1

But yup! Confirmed. That worked. Thank you!

from react-obfuscate.

coston avatar coston commented on September 28, 2024

Hey @jordanlambrecht, it looks like your are obfuscating page links. In that case, it's working as expected. Part of the point of react-obfuscate is to obfuscate email addresses, other text, or [in this case] links that you don't want picked up by a crawler (e.g. Google Search Console).

For the pages in your screenshot, I recommend that you do not obfuscate those links.

from react-obfuscate.

jordanlambrecht avatar jordanlambrecht commented on September 28, 2024

Hey @coston, I don't think I am. Here are two examples of my code:

import Obfuscate from 'react-obfuscate'

export const Footer: NextPage = () => {
  return (
                    <li className='mt-3 text-xl text-cream'>
                      <Obfuscate tel={'402-302-0323'} className={'text-cream  '}>
                        402 302 0323
                      </Obfuscate>
                    </li>
  )
}

export default Footer
import Obfuscate from 'react-obfuscate'
const About_Team_Header = ({ source, frontMatter }) => {
  return (
 <Obfuscate
                  email={frontMatter.email}
                  className={'block italic text-peach cursor-pointer text-left'}
                />
  )
}
export default About_Team_Header

from react-obfuscate.

coston avatar coston commented on September 28, 2024

@jordanlambrecht you are right. I get what the problem is now.
🎯 Because the email link href is "obfuscated", Google Search Console interprets it to be a relative link.

Quick solution: using the linkText prop, create your own obfuscated placeholder with the mailto: prefix (e.g. mailto:obfuscated.)

Package improvement: include all the Common Options prefixes in the obfuscated href so that contact urls aren't captured by crawlers as navigation links.

from react-obfuscate.

coston avatar coston commented on September 28, 2024

@jordanlambrecht please let me know what you think about my analysis of the problem and the solution. Also, are you interested in contributing the package improvement?

from react-obfuscate.

rodrigo-arias avatar rodrigo-arias commented on September 28, 2024

@coston thanks for creating this plugin. I wonder if by default the href attribute before human iteration should be generated with the prefix of the link used: email, tel, sms, etc. as appropriate and thus avoid issues with crawlers. Glad to submit a PR if you agree.

from react-obfuscate.

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.