....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 213.186.33.2  /  Your IP : 216.73.216.250
Web Server : Apache
System : Linux webd003.cluster102.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : uneseuleoc ( 96096)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/uneseuleoc/www/plugins/auto/facteur/v5.0.5/lib/markdownify/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/uneseuleoc/www/plugins/auto/facteur/v5.0.5/lib/markdownify/markdownify.php
<?php
/**
 * Markdownify converts HTML Markup to [Markdown][1] (by [John Gruber][2]. It
 * also supports [Markdown Extra][3] by [Michel Fortin][4] via Markdownify_Extra.
 *
 * It all started as `html2text.php` - a port of [Aaron Swartz'][5] [`html2text.py`][6] - but
 * got a long way since. This is far more than a mere port now!
 * Starting with version 2.0.0 this is a complete rewrite and cannot be
 * compared to Aaron Swatz' `html2text.py` anylonger. I'm now using a HTML parser
 * (see `parsehtml.php` which I also wrote) which makes most of the evil
 * RegEx magic go away and additionally it gives a much cleaner class
 * structure. Also notably is the fact that I now try to prevent regressions by
 * utilizing testcases of Michel Fortin's [MDTest][7].
 *
 * [1]: http://daringfireball.com/projects/markdown
 * [2]: http://daringfireball.com/
 * [3]: http://www.michelf.com/projects/php-markdown/extra/
 * [4]: http://www.michelf.com/
 * [5]: http://www.aaronsw.com/
 * [6]: http://www.aaronsw.com/2002/html2text/
 * [7]: http://article.gmane.org/gmane.text.markdown.general/2540
 *
 * @version 2.0.0 alpha
 * @author Milian Wolff (<mail@milianw.de>, <http://milianw.de>)
 * @license LGPL, see LICENSE_LGPL.txt and the summary below
 * @copyright (C) 2007  Milian Wolff
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

/**
 * HTML Parser, see http://sf.net/projects/parseHTML
 */
require_once dirname(__FILE__) . '/parsehtml/parsehtml.php';

/**
 * default configuration
 */
define('MDFY_LINKS_EACH_PARAGRAPH', false);
define('MDFY_BODYWIDTH', false);
define('MDFY_KEEPHTML', true);

/**
 * HTML to Markdown converter class
 */
class Markdownify {
  /**
   * html parser object
   *
   * @var parseHTML
   */
  var $parser;
  /**
   * markdown output
   *
   * @var string
   */
  var $output;
  /**
   * stack with tags which where not converted to html
   *
   * @var array<string>
   */
  var $notConverted = array();
  /**
   * skip conversion to markdown
   *
   * @var bool
   */
  var $skipConversion = false;
  /* options */
  /**
   * keep html tags which cannot be converted to markdown
   *
   * @var bool
   */
  var $keepHTML = false;
  /**
   * wrap output, set to 0 to skip wrapping
   *
   * @var int
   */
  var $bodyWidth = 0;
  /**
   * minimum body width
   *
   * @var int
   */
  var $minBodyWidth = 25;
  /**
   * display links after each paragraph
   *
   * @var bool
   */
  var $linksAfterEachParagraph = false;
  /**
   * constructor, set options, setup parser
   *
   * @param bool $linksAfterEachParagraph wether or not to flush stacked links after each paragraph
   *             defaults to false
   * @param int $bodyWidth wether or not to wrap the output to the given width
   *             defaults to false
   * @param bool $keepHTML wether to keep non markdownable HTML or to discard it
   *             defaults to true (HTML will be kept)
   * @return void
   */
  function __construct($linksAfterEachParagraph = MDFY_LINKS_EACH_PARAGRAPH, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML) {
    $this->linksAfterEachParagraph = $linksAfterEachParagraph;
    $this->keepHTML = $keepHTML;

    if ($bodyWidth > $this->minBodyWidth) {
      $this->bodyWidth = intval($bodyWidth);
    } else {
      $this->bodyWidth = false;
    }

    $this->parser = new parseHTML;
    $this->parser->noTagsInCode = true;

    # we don't have to do this every time
    $search = array();
    $replace = array();
    foreach ($this->escapeInText as $s => $r) {
      array_push($search, '#(?<!\\\)'.$s.'#U');
      array_push($replace, $r);
    }
    $this->escapeInText = array(
      'search' => $search,
      'replace' => $replace
    );
  }
  /**
   * parse a HTML string
   *
   * @param string $html
   * @return string markdown formatted
   */
  function parseString($html) {
    $this->parser->html = $html;
    $this->parse();
    return $this->output;
  }
  /**
   * tags with elements which can be handled by markdown
   *
   * @var array<string>
   */
  var $isMarkdownable = array(
    'p' => array(),
    'ul' => array(),
    'ol' => array(),
    'li' => array(),
    'br' => array(),
    'blockquote' => array(),
    'code' => array(),
    'pre' => array(),
    'a' => array(
      'href' => 'required',
      'title' => 'optional',
    ),
    'strong' => array(),
    'b' => array(),
    'em' => array(),
    'i' => array(),
    'img' => array(
      'src' => 'required',
      'alt' => 'optional',
      'title' => 'optional',
    ),
    'h1' => array(),
    'h2' => array(),
    'h3' => array(),
    'h4' => array(),
    'h5' => array(),
    'h6' => array(),
    'hr' => array(),
  );
  /**
   * html tags to be ignored (contents will be parsed)
   *
   * @var array<string>
   */
  var $ignore = array(
    'html',
    'body',
  );
  /**
   * html tags to be dropped (contents will not be parsed!)
   *
   * @var array<string>
   */
  var $drop = array(
    'script',
    'head',
    'style',
    'form',
    'area',
    'object',
    'param',
    'iframe',
  );
  /**
   * Markdown indents which could be wrapped
   * @note: use strings in regex format
   *
   * @var array<string>
   */
  var $wrappableIndents = array(
    '\*   ', # ul
    '\d.  ', # ol
    '\d\d. ', # ol
    '> ', # blockquote
    '', # p
  );
  /**
   * list of chars which have to be escaped in normal text
   * @note: use strings in regex format
   *
   * @var array
   *
   * TODO: what's with block chars / sequences at the beginning of a block?
   */
  var $escapeInText = array(
    '([-*_])([ ]{0,2}\1){2,}' => '\\\\$0|', # hr
    '\*\*([^*\s]+)\*\*' => '\*\*$1\*\*', # strong
    '\*([^*\s]+)\*' => '\*$1\*', # em
    '__(?! |_)(.+)(?!<_| )__' => '\_\_$1\_\_', # em
    '_(?! |_)(.+)(?!<_| )_' => '\_$1\_', # em
    '`(.+)`' => '\`$1\`', # code
    '\[(.+)\](\s*\()' => '\[$1\]$2', # links: [text] (url) => [text\] (url)
    '\[(.+)\](\s*)\[(.*)\]' => '\[$1\]$2\[$3\]', # links: [text][id] => [text\][id\]
  );
  /**
   * wether last processed node was a block tag or not
   *
   * @var bool
   */
  var $lastWasBlockTag = false;
  /**
   * name of last closed tag
   *
   * @var string
   */
  var $lastClosedTag = '';
  /**
   * iterate through the nodes and decide what we
   * shall do with the current node
   *
   * @param void
   * @return void
   */
  function parse() {
    $this->output = '';
    # drop tags
    $this->parser->html = preg_replace('#<('.implode('|', $this->drop).')[^>]*>.*</\\1>#sU', '', $this->parser->html);
    while ($this->parser->nextNode()) {
      switch ($this->parser->nodeType) {
        case 'doctype':
          break;
        case 'pi':
        case 'comment':
          if ($this->keepHTML) {
            $this->flushLinebreaks();
            $this->out($this->parser->node);
            $this->setLineBreaks(2);
          }
          # else drop
          break;
        case 'text':
          $this->handleText();
          break;
        case 'tag':
          if (in_array($this->parser->tagName, $this->ignore)) {
            break;
          }
          if ($this->parser->isStartTag) {
            $this->flushLinebreaks();
          }
          if ($this->skipConversion) {
            $this->isMarkdownable(); # update notConverted
            $this->handleTagToText();
            break;
          }
          if (!$this->parser->keepWhitespace && $this->parser->isBlockElement && $this->parser->isStartTag) {
            $this->parser->html = ltrim($this->parser->html);
          }
          if ($this->isMarkdownable()) {
            if ($this->parser->isBlockElement && $this->parser->isStartTag && !$this->lastWasBlockTag && !empty($this->output)) {
              if (!empty($this->buffer)) {
                $str =& $this->buffer[count($this->buffer) -1];
              } else {
                $str =& $this->output;
              }
              if (substr($str, -strlen($this->indent)-1) != "\n".$this->indent) {
                $str .= "\n".$this->indent;
              }
            }
            $func = 'handleTag_'.$this->parser->tagName;
            $this->$func();
            if ($this->linksAfterEachParagraph && $this->parser->isBlockElement && !$this->parser->isStartTag && empty($this->parser->openTags)) {
              $this->flushStacked();
            }
            if (!$this->parser->isStartTag) {
              $this->lastClosedTag = $this->parser->tagName;
            }
          } else {
            $this->handleTagToText();
            $this->lastClosedTag = '';
          }
          break;
        default:
          trigger_error('invalid node type', E_USER_ERROR);
          break;
      }
      $this->lastWasBlockTag = $this->parser->nodeType == 'tag' && $this->parser->isStartTag && $this->parser->isBlockElement;
    }
    if (!empty($this->buffer)) {
      trigger_error('buffer was not flushed, this is a bug. please report!', E_USER_WARNING);
      while (!empty($this->buffer)) {
        $this->out($this->unbuffer());
      }
    }
    ### cleanup
    $this->output = rtrim(str_replace('&amp;', '&', str_replace('&lt;', '<', str_replace('&gt;', '>', $this->output))));
    # end parsing, flush stacked tags
    $this->flushStacked();
    $this->stack = array();
  }
  /**
   * check if current tag can be converted to Markdown
   *
   * @param void
   * @return bool
   */
  function isMarkdownable() {
    if (!isset($this->isMarkdownable[$this->parser->tagName])) {
      # simply not markdownable
      return false;
    }
    if ($this->parser->isStartTag) {
      $return = true;
      if ($this->keepHTML) {
        $diff = array_diff(array_keys($this->parser->tagAttributes), array_keys($this->isMarkdownable[$this->parser->tagName]));
        if (!empty($diff)) {
          # non markdownable attributes given
          $return = false;
        }
      }
      if ($return) {
        foreach ($this->isMarkdownable[$this->parser->tagName] as $attr => $type) {
          if ($type == 'required' && !isset($this->parser->tagAttributes[$attr])) {
            # required markdown attribute not given
            $return = false;
            break;
          }
        }
      }
      if (!$return) {
        array_push($this->notConverted, $this->parser->tagName.'::'.implode('/', $this->parser->openTags));
      }
      return $return;
    } else {
      if (!empty($this->notConverted) && end($this->notConverted) === $this->parser->tagName.'::'.implode('/', $this->parser->openTags)) {
        array_pop($this->notConverted);
        return false;
      }
      return true;
    }
  }
  /**
   * output all stacked tags
   *
   * @param void
   * @return void
   */
  function flushStacked() {
    # links
    foreach ($this->stack as $tag => $a) {
      if (!empty($a)) {
        call_user_func(array(&$this, 'flushStacked_'.$tag));
      }
    }
  }
  /**
   * output link references (e.g. [1]: http://example.com "title");
   *
   * @param void
   * @return void
   */
  function flushStacked_a() {
    $out = false;
    foreach ($this->stack['a'] as $k => $tag) {
      if (!isset($tag['unstacked'])) {
        if (!$out) {
          $out = true;
          $this->out("\n\n", true);
        } else {
          $this->out("\n", true);
        }
        $this->out(' ['.$tag['linkID'].']: '.$tag['href'].(isset($tag['title']) ? ' "'.$tag['title'].'"' : ''), true);
        $tag['unstacked'] = true;
        $this->stack['a'][$k] = $tag;
      }
    }
  }
  /**
   * flush enqued linebreaks
   *
   * @param void
   * @return void
   */
  function flushLinebreaks() {
    if ($this->lineBreaks && !empty($this->output)) {
      $this->out(str_repeat("\n".$this->indent, $this->lineBreaks), true);
    }
    $this->lineBreaks = 0;
  }
  /**
   * handle non Markdownable tags
   *
   * @param void
   * @return void
   */
  function handleTagToText() {
    if (!$this->keepHTML) {
      if (!$this->parser->isStartTag && $this->parser->isBlockElement) {
        $this->setLineBreaks(2);
      }
    } else {
      # dont convert to markdown inside this tag
      /** TODO: markdown extra **/
      if (!$this->parser->isEmptyTag) {
        if ($this->parser->isStartTag) {
          if (!$this->skipConversion) {
            $this->skipConversion = $this->parser->tagName.'::'.implode('/', $this->parser->openTags);
          }
        } else {
          if ($this->skipConversion == $this->parser->tagName.'::'.implode('/', $this->parser->openTags)) {
            $this->skipConversion = false;
          }
        }
      }

      if ($this->parser->isBlockElement) {
        if ($this->parser->isStartTag) {
          if (in_array($this->parent(), array('ins', 'del'))) {
            # looks like ins or del are block elements now
            $this->out("\n", true);
            $this->indent('  ');
          }
          if ($this->parser->tagName != 'pre') {
            $this->out($this->parser->node."\n".$this->indent);
            if (!$this->parser->isEmptyTag) {
              $this->indent('  ');
            } else {
              $this->setLineBreaks(1);
            }
            $this->parser->html = ltrim($this->parser->html);
          } else {
            # don't indent inside <pre> tags
            $this->out($this->parser->node);
            static $indent;
            $indent =  $this->indent;
            $this->indent = '';
          }
        } else {
          if (!$this->parser->keepWhitespace) {
            $this->output = rtrim($this->output);
          }
          if ($this->parser->tagName != 'pre') {
            $this->indent('  ');
            $this->out("\n".$this->indent.$this->parser->node);
          } else {
            # reset indentation
            $this->out($this->parser->node);
            static $indent;
            $this->indent = $indent;
          }

          if (in_array($this->parent(), array('ins', 'del'))) {
            # ins or del was block element
            $this->out("\n");
            $this->indent('  ');
          }
          if ($this->parser->tagName == 'li') {
            $this->setLineBreaks(1);
          } else {
            $this->setLineBreaks(2);
          }
        }
      } else {
        $this->out($this->parser->node);
      }
      if (in_array($this->parser->tagName, array('code', 'pre'))) {
        if ($this->parser->isStartTag) {
          $this->buffer();
        } else {
          # add stuff so cleanup just reverses this
          $this->out(str_replace('&lt;', '&amp;lt;', str_replace('&gt;', '&amp;gt;', $this->unbuffer())));
        }
      }
    }
  }
  /**
   * handle plain text
   *
   * @param void
   * @return void
   */
  function handleText() {
    if ($this->hasParent('pre') && strpos($this->parser->node, "\n") !== false) {
      $this->parser->node = str_replace("\n", "\n".$this->indent, $this->parser->node);
    }
    if (!$this->hasParent('code') && !$this->hasParent('pre')) {
      # entity decode
      $this->parser->node = $this->decode($this->parser->node);
      if (!$this->skipConversion) {
        # escape some chars in normal Text
        $this->parser->node = preg_replace($this->escapeInText['search'], $this->escapeInText['replace'], $this->parser->node);
      }
    } else {
      $this->parser->node = str_replace(array('&quot;', '&apos'), array('"', '\''), $this->parser->node);
    }
    $this->out($this->parser->node);
    $this->lastClosedTag = '';
  }
  /**
   * handle <em> and <i> tags
   *
   * @param void
   * @return void
   */
  function handleTag_em() {
    $this->out('*', true);
  }
  function handleTag_i() {
    $this->handleTag_em();
  }
  /**
   * handle <strong> and <b> tags
   *
   * @param void
   * @return void
   */
  function handleTag_strong() {
    $this->out('**', true);
  }
  function handleTag_b() {
    $this->handleTag_strong();
  }
  /**
   * handle <h1> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h1() {
    $this->handleHeader(1);
  }
  /**
   * handle <h2> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h2() {
    $this->handleHeader(2);
  }
  /**
   * handle <h3> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h3() {
    $this->handleHeader(3);
  }
  /**
   * handle <h4> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h4() {
    $this->handleHeader(4);
  }
  /**
   * handle <h5> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h5() {
    $this->handleHeader(5);
  }
  /**
   * handle <h6> tags
   *
   * @param void
   * @return void
   */
  function handleTag_h6() {
    $this->handleHeader(6);
  }
  /**
   * number of line breaks before next inline output
   */
  var $lineBreaks = 0;
  /**
   * handle header tags (<h1> - <h6>)
   *
   * @param int $level 1-6
   * @return void
   */
  function handleHeader($level) {
    if ($this->parser->isStartTag) {
      $this->out(str_repeat('#', $level).' ', true);
    } else {
      $this->setLineBreaks(2);
    }
  }
  /**
   * handle <p> tags
   *
   * @param void
   * @return void
   */
  function handleTag_p() {
    if (!$this->parser->isStartTag) {
      $this->setLineBreaks(2);
    }
  }
  /**
   * handle <a> tags
   *
   * @param void
   * @return void
   */
  function handleTag_a() {
    if ($this->parser->isStartTag) {
      $this->buffer();
      if (isset($this->parser->tagAttributes['title'])) {
        $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
      } else {
        $this->parser->tagAttributes['title'] = null;
      }
      $this->parser->tagAttributes['href'] = $this->decode(trim($this->parser->tagAttributes['href']));
      $this->stack();
    } else {
      $tag = $this->unstack();
      $buffer = $this->unbuffer();

      if (empty($tag['href']) && empty($tag['title'])) {
        # empty links... testcase mania, who would possibly do anything like that?!
        $this->out('['.$buffer.']()', true);
        return;
      }

      if ($buffer == $tag['href'] && empty($tag['title'])) {
        # <http://example.com>
        $this->out('<'.$buffer.'>', true);
        return;
      }

      $bufferDecoded = $this->decode(trim($buffer));
      if (substr($tag['href'], 0, 7) == 'mailto:' && 'mailto:'.$bufferDecoded == $tag['href']) {
        if (is_null($tag['title'])) {
          # <mail@example.com>
          $this->out('<'.$bufferDecoded.'>', true);
          return;
        }
        # [mail@example.com][1]
        # ...
        #  [1]: mailto:mail@example.com Title
        $tag['href'] = 'mailto:'.$bufferDecoded;
      }
	    if ($this->linksAfterEachParagraph!=='inline'){
	      # [This link][id]
	      foreach ($this->stack['a'] as $tag2) {
	        if ($tag2['href'] == $tag['href'] && $tag2['title'] === $tag['title']) {
	          $tag['linkID'] = $tag2['linkID'];
	          break;
	        }
	      }
	      if (!isset($tag['linkID'])) {
	        $tag['linkID'] = count($this->stack['a']) + 1;
	        array_push($this->stack['a'], $tag);
	      }

	      $this->out('['.trim($buffer).']['.$tag['linkID'].']', true);
	    }
	    else {
		    # [This link|title](url)
		    if ($tag['title'])
			    $buffer.="|".$tag['title'];
		    $this->out('['.trim($buffer).']('.$tag['href'].')', true);
	    }
    }
  }
  /**
   * handle <img /> tags
   *
   * @param void
   * @return void
   */
  function handleTag_img() {
    if (!$this->parser->isStartTag) {
      return; # just to be sure this is really an empty tag...
    }

    if (isset($this->parser->tagAttributes['title'])) {
      $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
    } else {
      $this->parser->tagAttributes['title'] = null;
    }
    if (isset($this->parser->tagAttributes['alt'])) {
      $this->parser->tagAttributes['alt'] = $this->decode($this->parser->tagAttributes['alt']);
    } else {
      $this->parser->tagAttributes['alt'] = null;
    }

    if (empty($this->parser->tagAttributes['src'])) {
      # support for "empty" images... dunno if this is really needed
      # but there are some testcases which do that...
      if (!empty($this->parser->tagAttributes['title'])) {
        $this->parser->tagAttributes['title'] = ' '.$this->parser->tagAttributes['title'].' ';
      }
      $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['title'].')', true);
      return;
    } else {
      $this->parser->tagAttributes['src'] = $this->decode($this->parser->tagAttributes['src']);
    }

    # [This link][id]
    $link_id = false;
    if (!empty($this->stack['a'])) {
      foreach ($this->stack['a'] as $tag) {
        if ($tag['href'] == $this->parser->tagAttributes['src']
            && $tag['title'] === $this->parser->tagAttributes['title']) {
          $link_id = $tag['linkID'];
          break;
        }
      }
    } else {
      $this->stack['a'] = array();
    }
    if (!$link_id) {
      $link_id = count($this->stack['a']) + 1;
      $tag = array(
        'href' => $this->parser->tagAttributes['src'],
        'linkID' => $link_id,
        'title' => $this->parser->tagAttributes['title']
      );
      array_push($this->stack['a'], $tag);
    }

    $this->out('!['.$this->parser->tagAttributes['alt'].']['.$link_id.']', true);
  }
  /**
   * handle <code> tags
   *
   * @param void
   * @return void
   */
  function handleTag_code() {
    if ($this->hasParent('pre')) {
      # ignore code blocks inside <pre>
      return;
    }
    if ($this->parser->isStartTag) {
      $this->buffer();
    } else {
      $buffer = $this->unbuffer();
      # use as many backticks as needed
      preg_match_all('#`+#', $buffer, $matches);
      if (!empty($matches[0])) {
        rsort($matches[0]);

        $ticks = '`';
        while (true) {
          if (!in_array($ticks, $matches[0])) {
            break;
          }
          $ticks .= '`';
        }
      } else {
        $ticks = '`';
      }
      if ($buffer[0] == '`' || substr($buffer, -1) == '`') {
        $buffer = ' '.$buffer.' ';
      }
      $this->out($ticks.$buffer.$ticks, true);
    }
  }
  /**
   * handle <pre> tags
   *
   * @param void
   * @return void
   */
  function handleTag_pre() {
    if ($this->keepHTML && $this->parser->isStartTag) {
      # check if a simple <code> follows
      if (!preg_match('#^\s*<code\s*>#Us', $this->parser->html)) {
        # this is no standard markdown code block
        $this->handleTagToText();
        return;
      }
    }
    $this->indent('    ');
    if (!$this->parser->isStartTag) {
      $this->setLineBreaks(2);
    } else {
      $this->parser->html = ltrim($this->parser->html);
    }
  }
  /**
   * handle <blockquote> tags
   *
   * @param void
   * @return void
   */
  function handleTag_blockquote() {
    $this->indent('> ');
  }
  /**
   * handle <ul> tags
   *
   * @param void
   * @return void
   */
  function handleTag_ul() {
    if ($this->parser->isStartTag) {
      $this->stack();
      if (!$this->keepHTML && $this->lastClosedTag == $this->parser->tagName) {
        $this->out("\n".$this->indent.'<!-- -->'."\n".$this->indent."\n".$this->indent);
      }
    } else {
      $this->unstack();
      if ($this->parent() != 'li' || preg_match('#^\s*(</li\s*>\s*<li\s*>\s*)?<(p|blockquote)\s*>#sU', $this->parser->html)) {
        # dont make Markdown add unneeded paragraphs
        $this->setLineBreaks(2);
      }
    }
  }
  /**
   * handle <ul> tags
   *
   * @param void
   * @return void
   */
  function handleTag_ol() {
    # same as above
    $this->parser->tagAttributes['num'] = 0;
    $this->handleTag_ul();
  }
  /**
   * handle <li> tags
   *
   * @param void
   * @return void
   */
  function handleTag_li() {
    if ($this->parent() == 'ol') {
      $parent =& $this->getStacked('ol');
      if ($this->parser->isStartTag) {
        $parent['num']++;
        $this->out($parent['num'].'.'.str_repeat(' ', 3 - strlen($parent['num'])), true);
      }
      $this->indent('    ', false);
    } else {
      if ($this->parser->isStartTag) {
        $this->out('*   ', true);
      }
      $this->indent('    ', false);
    }
    if (!$this->parser->isStartTag) {
      $this->setLineBreaks(1);
    }
  }
  /**
   * handle <hr /> tags
   *
   * @param void
   * @return void
   */
  function handleTag_hr() {
    if (!$this->parser->isStartTag) {
      return; # just to be sure this really is an empty tag
    }
    $this->out('* * *', true);
    $this->setLineBreaks(2);
  }
  /**
   * handle <br /> tags
   *
   * @param void
   * @return void
   */
  function handleTag_br() {
    $this->out("  \n".$this->indent, true);
    $this->parser->html = ltrim($this->parser->html);
  }
  /**
   * node stack, e.g. for <a> and <abbr> tags
   *
   * @var array<array>
   */
  var $stack = array();
  /**
   * add current node to the stack
   * this only stores the attributes
   *
   * @param void
   * @return void
   */
  function stack() {
    if (!isset($this->stack[$this->parser->tagName])) {
      $this->stack[$this->parser->tagName] = array();
    }
    array_push($this->stack[$this->parser->tagName], $this->parser->tagAttributes);
  }
  /**
   * remove current tag from stack
   *
   * @param void
   * @return array
   */
  function unstack() {
    if (!isset($this->stack[$this->parser->tagName]) || !is_array($this->stack[$this->parser->tagName])) {
      trigger_error('Trying to unstack from empty stack. This must not happen.', E_USER_ERROR);
    }
    return array_pop($this->stack[$this->parser->tagName]);
  }
  /**
   * get last stacked element of type $tagName
   *
   * @param string $tagName
   * @return array
   */
  function & getStacked($tagName) {
    // no end() so it can be referenced
    return $this->stack[$tagName][count($this->stack[$tagName])-1];
  }
  /**
   * set number of line breaks before next start tag
   *
   * @param int $number
   * @return void
   */
  function setLineBreaks($number) {
    if ($this->lineBreaks < $number) {
      $this->lineBreaks = $number;
    }
  }
  /**
   * stores current buffers
   *
   * @var array<string>
   */
  var $buffer = array();
  /**
   * buffer next parser output until unbuffer() is called
   *
   * @param void
   * @return void
   */
  function buffer() {
    array_push($this->buffer, '');
  }
  /**
   * end current buffer and return buffered output
   *
   * @param void
   * @return string
   */
  function unbuffer() {
    return array_pop($this->buffer);
  }
  /**
   * append string to the correct var, either
   * directly to $this->output or to the current
   * buffers
   *
   * @param string $put
   * @return void
   */
  function out($put, $nowrap = false) {
    if (empty($put)) {
      return;
    }
    if (!empty($this->buffer)) {
      $this->buffer[count($this->buffer) - 1] .= $put;
    } else {
      if ($this->bodyWidth && !$this->parser->keepWhitespace) { # wrap lines
        // get last line
        $pos = strrpos($this->output, "\n");
        if ($pos === false) {
          $line = $this->output;
        } else {
          $line = substr($this->output, $pos);
        }

        if ($nowrap) {
          if ($put[0] != "\n" && $this->strlen($line) + $this->strlen($put) > $this->bodyWidth) {
            $this->output .= "\n".$this->indent.$put;
          } else {
            $this->output .= $put;
          }
          return;
        } else {
          $put .= "\n"; # make sure we get all lines in the while below
          $lineLen = $this->strlen($line);
          while ($pos = strpos($put, "\n")) {
            $putLine = substr($put, 0, $pos+1);
            $put = substr($put, $pos+1);
            $putLen = $this->strlen($putLine);
            if ($lineLen + $putLen < $this->bodyWidth) {
              $this->output .= $putLine;
              $lineLen = $putLen;
            } else {
              $split = preg_split('#^(.{0,'.($this->bodyWidth - $lineLen).'})\b#', $putLine, 2, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE);
              $this->output .= rtrim($split[1][0])."\n".$this->indent.$this->wordwrap(ltrim($split[2][0]), $this->bodyWidth, "\n".$this->indent, false);
            }
          }
          $this->output = substr($this->output, 0, -1);
          return;
        }
      } else {
        $this->output .= $put;
      }
    }
  }
  /**
   * current indentation
   *
   * @var string
   */
  var $indent = '';
  /**
   * indent next output (start tag) or unindent (end tag)
   *
   * @param string $str indentation
   * @param bool $output add indendation to output
   * @return void
   */
  function indent($str, $output = true) {
    if ($this->parser->isStartTag) {
      $this->indent .= $str;
      if ($output) {
        $this->out($str, true);
      }
    } else {
      $this->indent = substr($this->indent, 0, -strlen($str));
    }
  }
  /**
   * decode email addresses
   *
   * @author derernst@gmx.ch <http://www.php.net/manual/en/function.html-entity-decode.php#68536>
   * @author Milian Wolff <http://milianw.de>
   */
  function decode($text, $quote_style = ENT_QUOTES) {
    if (version_compare(PHP_VERSION, '5', '>=')) {
      # UTF-8 is only supported in PHP 5.x.x and above
      $text = html_entity_decode($text, $quote_style, 'UTF-8');
    } else {
      if (function_exists('html_entity_decode')) {
        $text = html_entity_decode($text, $quote_style, 'ISO-8859-1');
      } else {
        static $trans_tbl;
        if (!isset($trans_tbl)) {
          $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, $quote_style));
        }
        $text = strtr($text, $trans_tbl);
      }
      $text = preg_replace_callback('~&#x([0-9a-f]+);~i', array(&$this, '_decode_hex'), $text);
      $text = preg_replace_callback('~&#(\d{2,5});~', array(&$this, '_decode_numeric'), $text);
    }
    return $text;
  }
  /**
   * callback for decode() which converts a hexadecimal entity to UTF-8
   *
   * @param array $matches
   * @return string UTF-8 encoded
   */
  function _decode_hex($matches) {
    return $this->unichr(hexdec($matches[1]));
  }
  /**
   * callback for decode() which converts a numerical entity to UTF-8
   *
   * @param array $matches
   * @return string UTF-8 encoded
   */
  function _decode_numeric($matches) {
    return $this->unichr($matches[1]);
  }
  /**
   * UTF-8 chr() which supports numeric entities
   *
   * @author grey - greywyvern - com <http://www.php.net/manual/en/function.chr.php#55978>
   * @param array $matches
   * @return string UTF-8 encoded
   */
  function unichr($dec) {
    if ($dec < 128) {
      $utf = chr($dec);
    } else if ($dec < 2048) {
      $utf = chr(192 + (($dec - ($dec % 64)) / 64));
      $utf .= chr(128 + ($dec % 64));
    } else {
      $utf = chr(224 + (($dec - ($dec % 4096)) / 4096));
      $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
      $utf .= chr(128 + ($dec % 64));
    }
    return $utf;
  }
  /**
   * UTF-8 strlen()
   *
   * @param string $str
   * @return int
   *
   * @author dtorop 932 at hotmail dot com <http://www.php.net/manual/en/function.strlen.php#37975>
   * @author Milian Wolff <http://milianw.de>
   */
  function strlen($str) {
    if (function_exists('mb_strlen')) {
      return mb_strlen($str, 'UTF-8');
    } else {
      return preg_match_all('/[\x00-\x7F\xC0-\xFD]/', $str, $var_empty);
    }
  }
  /**
  * wordwrap for utf8 encoded strings
  *
  * @param string $str
  * @param integer $len
  * @param string $what
  * @return string
  */
  function wordwrap($str, $width, $break, $cut = false){
    if (!$cut) {
      $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){1,'.$width.'}\b#';
    } else {
      $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.'}#';
    }
    $return = '';
    while (preg_match($regexp, $str, $matches)) {
      $string = $matches[0];
      $str = ltrim(substr($str, strlen($string)));
      if (!$cut && isset($str[0]) && in_array($str[0], array('.', '!', ';', ':', '?', ','))) {
        $string .= $str[0];
        $str = ltrim(substr($str, 1));
      }
      $return .= $string.$break;
    }
    return $return.ltrim($str);
  }
  /**
   * check if current node has a $tagName as parent (somewhere, not only the direct parent)
   *
   * @param string $tagName
   * @return bool
   */
  function hasParent($tagName) {
    return in_array($tagName, $this->parser->openTags);
  }
  /**
   * get tagName of direct parent tag
   *
   * @param void
   * @return string $tagName
   */
  function parent() {
    return end($this->parser->openTags);
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit