Skip to content

Commit 2be4701

Browse files
committed
Cleaned up the code we've already added.
1 parent 262887d commit 2be4701

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

src/Converter.php

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -155,28 +155,21 @@ function markdownToBB(): self {
155155
$md = preg_quote($md);
156156
$this->text = preg_replace("/^{$md}(?:\s*)(.*?)$/m", "[{$bb}]$1[/{$bb}]", $this->text);
157157
}
158-
//
159-
// foreach (static::$bbPrefixes as $bb => $md){
160-
// $open = preg_quote("[$bb]");
161-
// $close = preg_quote("[/$bb]");
162-
// $close = str_replace('/', '\\/', $close);
163-
//
164-
// $this->text = preg_replace("/^{$open}(.*?){$close}/m", "{$md} $1", $this->text);
165-
// $this->text = preg_replace("/{$open}(.*?){$close}/", "\n{$md} $1", $this->text);
166-
// }
167-
// foreach (static::$bbAttributeTags as $key => $data){
168-
// $this->text = preg_replace_callback($data['regex'], function($match) use ($data){
169-
// $attribs = [];
170-
// foreach ($data['attributes'] as $key => $attribute){
171-
// $attribs["{{$key}}"] = empty($match[$attribute['value']]) ?
172-
// (isset($attribute['default']) ?
173-
// (is_numeric($attribute['default']) ? $match[$attribute['default']] : $attribute['default']) :
174-
// ''
175-
// ) : $match[$attribute['value']];
176-
// }
177-
// return strtr($data['template'], $attribs);
178-
// }, $this->text);
179-
// }
158+
159+
// TODO: Add attributed tags support.
160+
// foreach (static::$bbAttributeTags as $key => $data){
161+
// $this->text = preg_replace_callback($data['regex'], function($match) use ($data){
162+
// $attribs = [];
163+
// foreach ($data['attributes'] as $key => $attribute){
164+
// $attribs["{{$key}}"] = empty($match[$attribute['value']]) ?
165+
// (isset($attribute['default']) ?
166+
// (is_numeric($attribute['default']) ? $match[$attribute['default']] : $attribute['default']) :
167+
// ''
168+
// ) : $match[$attribute['value']];
169+
// }
170+
// return strtr($data['template'], $attribs);
171+
// }, $this->text);
172+
// }
180173

181174
return $this;
182175
}

0 commit comments

Comments
 (0)