
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
This repository is the reference client-side implemention of PRT, a safe, small and strict rich text serialisation protocol.
TODO: Add real documentation here...
Using the following MyComponent
:
import { Component } from 'react';
import PRTComponent from 'prt/component';
class MyComponent extends Component {
render = () => {
const document = {
type : 'PRTDocument',
version : '2.0',
dialect : 'pop',
elements : [[0, {href: '#'}, 'click here']],
};
return <PRTComponent content={document} />;
};
}
it will be rendered as:
<div>
<a href="#">click here</a>
</div>
Create custom dialect:
import registerPRTDialectByNameAndVersion from 'prt';
import PRTDialect from 'prt/v2/dialect';
import { MyProjX,
MyProjY,
MyProjZ,
MyProjEmpty } from 'my-proj';
class MyProjDialect extends PRTDialect {
identifierToElement = identifier => {
switch (identifier) {
case 0 : return <MyProjX />;
case 1 : return <MyProjY />;
case 2 : return <MyProjZ />;
default : return <MyProjEmpty />;
}
}
attributeToProp = (identifier, name, value) = {
if (identifier === 2 &&
name === 'contenteditable') {
name = 'editability';
value = value === 'true' ? 'enabled' : 'disabled';
}
return [name, value];
};
}
registerPRTDialectByNameAndVersion('my-proj', '2.0', MyProjDialect);
Start demo app with
$ yarn storybook
Copyright ©2017 We Got POP Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Client side reference implementation of the PRT protocol
We found that prt-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.