editorjs html
Nested List Support
فائدة لتحرير محررات تنظيف البيانات إلى HTML.
parseStrict() والتحقق validate() .المتصفح - get /.
Nodejs - get /.build/edjshtml.node.js
لكل من المتصفح والعقدة - get /.build/edjshtml.js
npm install editorjs-html const edjsParser = edjsHTML ( ) ;
let html = edjsParser . parse ( editorjs_clean_data ) ;
console . log ( html ) ; const edjsHTML = require ( "editorjs-html" ) ;
const edjsParser = edjsHTML ( ) ;
const html = edjsParser . parse ( editorjs_clean_data ) ;
console . log ( html ) ; انظر الإصدارات
const edjsParser = edjsHTML ( ) ;
const HTML = edjsParser . parse ( editorjs_data ) ;
// returns array of html strings per block
console . log ( HTML ) ; const edjsParser = edjsHTML ( ) ;
const HTML = edjsParser . parse ( editorjs_data ) ;
// returns an error
if ( HTML instanceof Error ) throw HTML ;
// in case of success, returns an array of strings
console . log ( HTML ) ; const edjsParser = edjsHTML ( ) ;
const blockHTML = edjsParser . parseBlock ( editorjs_data_block ) ;
// returns string of html for this block
console . log ( blockHTML ) ; const edjsParser = edjsHTML ( { } , { strict : true } ) ;
// returns the list of missing parser functions
const blockHTML = edjsParser . parse ( editorjs_data ) ;
console . log ( blockHTML ) ; يدعم editorjs-html وظائف تمديد وتجاوزات المحللون للكتل.
// Example Custom or Unrecognised Block
{
type : "custom" ,
data : {
text : "Hello World"
}
} // Parse this block in editorjs-html
function customParser ( block ) {
return `<custom-tag> ${ block . data . text } </custom-tag>` ;
}
const plugins = {
// The keyname must match with the type of block you want to parse with this funcion
custom : customParser
// ... add more or overwrite
}
const edjsParser = edjsHTML ( plugins ) ; يرجى إضافة مشكلة ، أو فتح العلاقات العامة لأي أخطاء أو مراجعة أو اقتراحات.
parsers/block-name . تحقق من الوظائف الحالية للاقتراحات.pnpm test && pnpm build .tests . تأكد من أن الاختبارات الخاصة بك تمر بتغطية مناسبة. أحب الحصول على ملاحظاتك وأي اقتراحات. يمكنك أيضًا إخباري ، إذا كنت بحاجة إلى دعم لمزيد من كتل EditorJS.
إذا وجدت هذا مفيدًا ، فكر في إعطاء هذا المستودع نجمًا. يمكنك أيضًا شراء قهوة هنا
رخصة معهد ماساتشوستس للتكنولوجيا
pavittarx