HTMLFilter.

Èò»ö ¸ñ·Ï HTML ÇÊÅÍ
Áö±Ý ´Ù¿î·Îµå

HTMLFilter. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • BSD License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Samuel Adam
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://github.com/samueladam/

HTMLFilter. ű×


HTMLFilter. ¼³¸í

Èò»ö ¸ñ·Ï HTML ÇÊÅÍ HTMLFilter´Â ¸Å¿ì °£´ÜÇÑ Èò»ö ¸ñ·Ï HTML ÇÊÅÍÀÔ´Ï´Ù. Ŭ¶óÀ̾ðÆ® Ãø¸é¿¡¼­ WYSIWYG ÆíÁý±â·Î »ç¿ëÇϽʽÿÀ. yousage ::: HTMLFilter °¡Á® ¿À±â htmlfilter htmlter () cleaned_html = hf.filter (dirty_html) ±ÔÄ¢ ÇÊÅÍ´Â ¹Ì¸® Á¤ÀÇ µÈ °ÍÀ¸·Î ³ªÅ¸³³´Ï´Ù. ±ÔÄ¢ÀÇ ÁýÇÕ. http://github.com/samueladam/htmlfilter/blob/master/htmlfilter/rules.pyyou ÀÚ½ÅÀÇ ±ÔÄ¢ ÆÄÀÏÀ» ¸¸µé ¼ö ÀÖ½À´Ï´Ù. # file : my_rules.pytags = { 'a': ( 'href,'name) , 'p': ( 'class',) # ¼Ó¼º µ¥ÀÌÅÍ (tag_attr) def p_class (µ¥ÀÌÅÍ)¿¡¼­ ÇÊÅÍ Á¤ÀÇ : µ¥ÀÌÅÍ°¡ ¾Æ´Ñ °æ¿ì ( 'class1', 'class2',) µ¥ÀÌÅÍ = ''¹Ýȯ µ¥ÀÌÅÍ ¹× »ç¿ë ÀÌ ¹æ¹ýÀ¸·Î : HTMLFilter °¡Á® ¿À±â htmlfilterimport my_ruleshf = htmlfilter (rules = my_rules) cleaned_html = hf.filter (dirty_html) ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã


HTMLFilter. °ü·Ã ¼ÒÇÁÆ®¿þ¾î

commiecc.

ÄÄÇ»ÅÍ ±³½Ç °ü¸®¸¦À§ÇÑ Ç÷¯±× °¡´É ½½·¹ÀÌºê ¸¶½ºÅÍ ÀÀ¿ë ÇÁ·Î±×·¥ ...

59

´Ù¿î·Îµå

advchk.

ÀÚ¹® Á¡°ËÀº º¸¾È ±Ç°í¸¦ ÀÐÁö ¾Êµµ·Ï º¸¾È Á¶¾ðÀ» ÀнÀ´Ï´Ù. ...

163

´Ù¿î·Îµå