
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Make links clickable in chosen HTML component preserving newlines symbols of your text
Not tested with Vue3
Vue directive to make links clickable in chosen HTML component, preserving newlines symbols of your text.
$ npm i dolinks
// import dolinks in your project root
import dolinks from 'dolinks'
// pass it to Vue.use() method
Vue.use(dolinks);
interface IOptions {
urlRegEx?: RegExp,
target?: '_self' | '_blank' | '_parent' | '_top',
disableWarnings?: boolean,
}
Pass options object as a Vue.use() parameter:
Vue.use(dolinks, options);
dolinks assumes that you'll pass your text to the template using the Vue "Mustache" syntax.
v-dolinks directive:{{ yourText }}<template>
<p v-dolinks :style="{'white-space': 'pre-wrap'}">
{{ yourText }}
</p>
</template>
<script>
data() {
return {
yourText: 'Some \n splited \n https://achievki.io \n here'
}
}
</script>
<p style="white-space: pre-wrap;">
"Some splited"
<a href="https://achievki.io" target="_blank">https://achievki.io</a>
" here"
</p>
<script>
data() {
return {
yourText: 'https://example.com Let`s try to pass some <script> with <a href="https://google.com">GOOGLE LINK</a> <\/script>'
}
}
</script>
<p style="white-space: pre-wrap;">
<a href="https://example.com" target="_blank">https://example.com</a>
" Let`s try to pass some <script> with <a href=""
<a href="https://google.com" target="_blank">https://google.com</a>
"">GOOGLE LINK</a> </script>
</p>
Should be valid RegExp. By this expression, dolinks will deside what text should be transformed to an <a> tag.
Text, matched this regex, also will be used as a value for href atribute.
Default:
/https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9@:%._\+~#=\/]{0,2048}/
The value for target atribute of an <a> tag. Should be a valid value for target:
If true - disables all dolinks warnings and errors. Default - false.
<p v-dolinks :key="yourText">{{ yourText }}</p>). update and componentUpdated Vue directive hooks not working correctly with 1.2.0 and disabled for 1.2.1.MIT © vladhutsal
FAQs
Make links clickable in chosen HTML component preserving newlines symbols of your text
We found that dolinks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.