![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@smartface/html-to-text
Advanced tools
You can convert html string to attributed strings for your textview component with this module
npm i --save @smartface/html-to-text
const TextView = require('sf-core/ui/textview');
const AttributedString = require("sf-core/ui/attributedstring");
const createAttributedStrings = require("@smartface/html-to-text");
const propFactory = require("@smartface/contx/lib/smartface/sfCorePropFactory").default;
var textView = new TextView();
var htmlSource = "<span style=\"font-size: 24px; color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0);\"><span style=\"font-family: Nunito-LightItalic; font-size: 24px; background-color: transparent; color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0);\">Your </span><font face=\"ios-Default-Bold\" style=\"font-size: 24px; font-family: ios-Default-Regular; background-color: transparent; color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0);\">attributed </font><span style=\"text-decoration-line: underline; color: rgb(139, 87, 42); font-size: 24px; font-family: ios-Default-Regular; background-color: transparent; text-decoration-color: rgb(0, 0, 0);\">Stri<span style=\"color: rgb(139, 87, 42); text-decoration-line: underline ; text-decoration-color: rgb(0, 0, 0); font-size: 24px; font-family: ios-Default-Regular; background-color: transparent;\">ngs</span></span></span><div><span style=\"font-size: 16px; font-family: ios-Default-Regular; text-decoration-color: rgb(0, 0, 0);\"><span style=\"text-decoration-line: underline; font-size: 16px; font-family: ios-Default-Regular; text-decoration-color: rgb(0, 0, 0);\"><span style=\"text-decoration-line: underline; text-decoration-color: rgb(0, 0, 0); font-size: 24px; font-family: ios-Default-Regular; background-color: rgb(189, 16, 224);\">second</span></span></span></div><div><span style=\"font-size: 16px; font-family: ios-Default-Regular; text-decoration-color: rgb(0, 0, 0);\"><span style=\"text-decoration-line: underline; font-size: 16px; font-family: ios-Default-Regular; text-decoration-color: rgb(0, 0, 0);\"><span style=\"text-decoration-line: underline; text-decoration-color: rgb(0, 0, 0); font-size: 16px; font-family: ios-Default-Regular; background-color: rgb(189, 16, 224); color: rgb(248, 231, 28);\">Third</span></span></span></div>";
var attributedStrings = createAttributedStrings(htmlSource);
textView.attributedText = attributedStrings.map(s => new AttributedString(propFactory(s)));
If you want to write newline character, you can use these tags <br>, <div> or use "\n".
You can use following html tags
You can only use following css styles
"font-family: Nunito-ExtraBold;"
"font-style: italic;"
"font-size: 24px;" (24pt, 24dp)
"font-weight: bold;"
"color: rgb(127, 125, 127);"
"background-color: rgb(255, 125, 127);"
"text-decoration-line: underline;"
"text-decoration-line: line-through;"
"click <a href=\"https://smartface.io\"> here </a> "
"text-decoration-color: rgba(255, 125, 128);"
"text-decoration-color: rgba(24, 126, 168);"
⚠️ If you give font-family style, this style can overwrite font-weight and font-style.
FAQs
html to attributedTexts
The npm package @smartface/html-to-text receives a total of 13 weekly downloads. As such, @smartface/html-to-text popularity was classified as not popular.
We found that @smartface/html-to-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.