Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/components/TextHighlight/UrlNode.jsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 773 Bytes
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/TextHighlight/UrlNode.jsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/components/TextHighlight/UrlNode.jsx
-
curl -L -o UrlNode.jsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/TextHighlight/UrlNode.jsx
773 Bytes
| import PropTypes from "prop-types"; | |
| import { HtxTextNode } from "./Node"; | |
| /** | |
| * Node for URL | |
| * @param {*} props | |
| */ | |
| const UrlNode = (props) => { | |
| const style = { wordWrap: "break-word" }; | |
| return ( | |
| <HtxTextNode | |
| id={props.id} | |
| highlightStyle={Object.assign({}, style, props.highlightStyle)} | |
| charIndex={props.charIndex} | |
| range={props.range} | |
| overlap={props.overlap} | |
| style={style} | |
| > | |
| <a data-position={props.charIndex + props.url.length} href={props.url} target="blank"> | |
| {props.url} | |
| </a> | |
| </HtxTextNode> | |
| ); | |
| }; | |
| UrlNode.propTypes = { | |
| highlightStyle: PropTypes.object, | |
| id: PropTypes.string, | |
| charIndex: PropTypes.number, | |
| range: PropTypes.object, | |
| url: PropTypes.string, | |
| }; | |
| export default UrlNode; | |