Lines Matching +full:fetch +full:- +full:depth
3 * This file is part of the clockoon/dokuwiki-commonmark-plugin package.
8 * - CommonMark JS reference parser (https://bitly.com/commonmark-js) (c) John MacFarlane
9 …* - league/commonmark (https://github.com/thephpleague/commonmark) (c) Colin O'Dell <colinodell@gm…
24 // [hid] => {[depth], [startline], [endline]}
35 $controller->register_hook('PARSER_WIKITEXT_PREPROCESS', 'BEFORE', $this,
37 if($this->getConf('fix_secedit')) {
38 $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this,
47 //echo(print_r($this->headingInfo));
48 //echo(print_r($this->linePosition).'<br />');
52 $hid = $event->data['hid'];
53 // fetch range on original md
55 $keys = array_keys($this->headingInfo);
65 $lineStart = $this->headingInfo[$hid]['startline'] - 1;
67 $start = $this->linePosition[$lineStart] + 1;
75 if (isset($keys[$index+1])) { // check for non-last element
76 $endlevel = $this->headingInfo[$keys[$index+1]]['level'];
77 … $lineEnd = $this->headingInfo[$keys[$index+1]]['startline'] - 1; // go one line up
78 $end = $this->linePosition[$lineEnd] + 1; // apply newline
87 $event->data['range'] = (string)$start.'-';
89 $event->data['range'] = (string)$start.'-'.$end;
93 // example: $event->data['range'] = '1-2';
97 $markdown = $event->data;
99 if ($this->getConf('force_commonmark')) {
101 …$result = Commonmark::RendtoDW($markdown, $this->getConf('frontmatter_tag'), $this->getConf('rende…
106 $result = Commonmark::RendtoDW($markdown, $this->getConf('frontmatter_tag'));
111 $event->data = $result['text'];
112 if ($this->firstRun == true) {
115 $this->linePosition[] = $lastPos;
117 $this->linePosition[] = $lastPos;
120 $this->headingInfo = $this->CleanHeadingInfo($result['heading']);
121 $this->FixHeadingLine($markdown);
122 $this->firstRun = false;
142 foreach($this->headingInfo as &$element) {
143 $target = $arr[$element['startline'] - 1];
147 $element['startline'] = $element['startline'] - 1;
148 $element['endline'] = $element['endline'] - 1;