示例#1
0
 public static function convertDataToAttributes($data)
 {
     // get ID of current CK instance
     $instance = RTE::getInstanceId();
     // properly encode JSON
     $encoded = RTEReverseParser::encodeRTEData($data);
     $encoded = Sanitizer::encodeAttribute($encoded);
     return " data-rte-meta=\"{$encoded}\" data-rte-instance=\"{$instance}\" ";
 }
示例#2
0
 /**
  * Perform wikitext parsing to HTML
  */
 public static function wiki2html()
 {
     wfProfileIn(__METHOD__);
     global $wgRequest;
     $wikitext = $wgRequest->getVal('wikitext', '');
     RTE::log(__METHOD__, $wikitext);
     $ret = array('html' => RTE::WikitextToHtml($wikitext), 'instanceId' => RTE::getInstanceId());
     if (RTE::edgeCasesFound()) {
         $ret = array('edgecase' => array('type' => RTE::getEdgeCaseType(), 'info' => array('title' => wfMsg('rte-edgecase-info-title'), 'content' => wfMsg('rte-edgecase-info'))));
     }
     wfProfileOut(__METHOD__);
     return $ret;
 }