Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupCodeBlockRule.php
| Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | public function markupText($text, $children) { | ||||
| } | } | ||||
| if ($options['name']) { | if ($options['name']) { | ||||
| $name_header = phutil_tag( | $name_header = phutil_tag( | ||||
| 'div', | 'div', | ||||
| $header_attributes, | $header_attributes, | ||||
| $options['name']); | $options['name']); | ||||
| } | } | ||||
| $class = 'remarkup-code-block'; | |||||
| if ($options['counterexample']) { | |||||
| $class = 'remarkup-code-block code-block-counterexample'; | |||||
| } | |||||
| $attributes = array( | $attributes = array( | ||||
| 'class' => 'remarkup-code-block', | 'class' => $class, | ||||
| 'data-code-lang' => $options['lang'], | 'data-code-lang' => $options['lang'], | ||||
| 'data-sigil' => 'remarkup-code-block', | 'data-sigil' => 'remarkup-code-block', | ||||
| ); | ); | ||||
| return phutil_tag( | return phutil_tag( | ||||
| 'div', | 'div', | ||||
| $attributes, | $attributes, | ||||
| array($name_header, $code_body)); | array($name_header, $code_body)); | ||||
| ▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines | |||||