
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@molecule/markdown
Advanced tools
A library providing an interface for markdown services and a corresponding pipe
Molecule Markdown provides you an Angular directive '# Title'|md
and a corresponding service, MarkdownService
, which allows you to provide any markdown parser you wish.
On the other hand, you need to provide a subclass for it in order to MarkdownPipe
.
@NgModule({
import: [MarkdownModule],
declarations: [MyComponent],
providers: [{
provide: MarkdownService,
useClass: YourMarkdownService
}]
})
export class MyModule {}
@Component({
template: '{{myMarkdownText|md}}'
})
export class MyComponent {
@Input() public myMarkdownText: string;
}
@Injectable()
export class MarkdedService extends MarkdownService {
constructor() {
marked.setOptions({ /* configuration options */ });
}
public markdownToHtml(markdown: string, ...args: any[]): string {
return marked(markdown, options);
}
}
@Injectable()
export class MarkdownItService extends MarkdownService {
private readonly markdownIt: MarkdownIt;
constructor() {
this.markdownIt = new MarkdownIt();
}
public markdownToHtml(markdown: string, ...args: any[]): string {
return this.markdownIt.render(markdown);
}
}
$ npm install --save @molecule/markdown
Valentin Knabel, @vknabel, dev@vknabel.com
@molecule/markdown is available under the MIT license.
FAQs
A library providing an interface for markdown services and a corresponding pipe
We found that @molecule/markdown 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.