Comments (7)
@coston am I a dick if I do linktext={'tel:911'}
from react-obfuscate.
But yup! Confirmed. That worked. Thank you!
from react-obfuscate.
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.
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.
@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.
@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.
@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)
- Still encountering reversal for emails containing dashes HOT 4
- Can't resolve 'react' in '.....react-obfuscate/dist' HOT 3
- Action Required: Fix Renovate Configuration
- Dependency Dashboard HOT 1
- thank you for this little snippet HOT 2
- Question - Is child element also obfuscate HOT 3
- Multiple obfuscations incompatible with css columns? HOT 8
- Text with letter spacing moves on hover HOT 3
- Typescript types declaration HOT 3
- Add className prop HOT 2
- SSR 404 error link
- Call for contribution: refactor tests to use React Testing Library
- Add support for PropTypes.elementType in the element prop
- Remove Prop-Types Dependency HOT 6
- Obfuscate emails in compiled js HOT 1
- An in-range update of next is breaking the build 🚨 HOT 5
- An in-range update of babel7 is breaking the build 🚨 HOT 14
- An in-range update of prettier is breaking the build 🚨 HOT 3
- mouseOver disables props.onClick HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-obfuscate.