Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@paulbarre/wc-furigana
Advanced tools
This Web Component is the easiest way to write japanese with furigana.
In HTML if you want to display 漢字 you need to write:
<ruby>漢
<rp>(</rp>
<rt>かん</rt>
<rp>)</rp>
</ruby>
<ruby>字
<rp>(</rp>
<rt>じ</rt>
<rp>)</rp>
</ruby>
Disclaimer
Yes.rp
tags are not a compulsory. 😀
With Furigana Web Component, things become easy:
<wc-furigana value="漢[かん]字[じ]" />
Check out how to use the component in details here: Furigana.
TL;DR
桜[さくら]
.私[わたし]はフランス 人[じん]です。
.一 二 三
.Note
The following applies the support for IE11, see below if you don't care about it.
The following consider an application created with Vue CLI.
npm i @paulbarre/wc-furigana
main.js
or main.ts
if you are using TypeScript
import { applyPolyfills, defineCustomElements } from '@paulbarre/wc-furigana/loader'
// The following can be set into your `vue.config.js` file
Vue.config.ignoredElements = [/wc-furigana/]
applyPolyfills().then(() => {
defineCustomElements(window)
})
wc-furigana
to App.vue
to see if the component is correctly loadedIf the above doesn't work, check out Stencil documentation about integration into a Vue app.
npm i @paulbarre/wc-furigana
If you don't have it already, create a configuration file. From root folder add a .vuepress
subfolder and create config.js
.
Add headers to this configuration file.
module.exports = {
head: [
['script', {
type: 'module',
src: 'https://unpkg.com/@paulbarre/wc-furigana@latest/dist/furigana/furigana.esm.js'
}],
['script', {
nomodule: true,
src: 'https://unpkg.com/@paulbarre/wc-furigana@latest/dist/furigana/furigana.js'
}]
]
}
Example
You can run the example inexamples
folder withnpm run serve
.
The following consider an application created with Angular CLI.
npm i @paulbarre/wc-furigana
CUSTOM_ELEMENTS_SCHEMA
to your application:app.module.ts
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
@NgModule({
...
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
main.ts
import { applyPolyfills, defineCustomElements } from '@paulbarre/wc-furigana/loader'
applyPolyfills().then(() => {
defineCustomElements(window)
})
wc-furigana
to app.component.html
to see if the component is correctly loadedIf the above doesn't work, check out Stencil documentation about integration into an Angular app.
The following consider an application created with Create React App.
npm i @paulbarre/wc-furigana
index.js
import { applyPolyfills, defineCustomElements } from '@paulbarre/wc-furigana/loader'
applyPolyfills().then(() => {
defineCustomElements(window)
})
wc-furigana
to App.js
to see if the component is correctly loadedIf the above doesn't work, check out Stencil documentation about integration into a React app.
If you don't need to support IE11, no need to apply Polyfills:
import { defineCustomElements } from '@paulbarre/wc-furigana/loader'
defineCustomElements(window)
Adding the Web Component into a single file without any framework is also possible
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module" src="https://unpkg.com/@paulbarre/wc-furigana@latest/dist/furigana/furigana.esm.js"></script>
<script nomodule src="https://unpkg.com/@paulbarre/wc-furigana@latest/dist/furigana/furigana.js"></script>
</head>
<body>
<wc-furigana value="漢[かん]字[じ]" />
</body>
</html>
Check out the folder examples to see how to integrate the component.
FAQs
Web component to display easily japanese with furigana
The npm package @paulbarre/wc-furigana receives a total of 5 weekly downloads. As such, @paulbarre/wc-furigana popularity was classified as not popular.
We found that @paulbarre/wc-furigana 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.