BugTrack/2513
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* 表組みの書式指定行構文に「太字」の追加 [#o3f40b36]
- ページ: [[BugTrack]]
- 投稿者: [[こん]]
- 優先順位: 低
- 状態: 完了
- カテゴリー: 本体新機能
- 投稿日: 2020-10-23 (金) 22:00:21
- バージョン: 1.5.3
- リリース予定バージョン: 1.5.4
** メッセージ [#xf71cc2f]
現在表組みの書式指定行にサポートされているのは
LEFT:
CENTER:
RIGHT:
BGCOLOR(色):
COLOR(色):
SIZE(サイズ):
の6つだけですが、ここに太字(BOLD:)の追加も希望したいです。
%%また、これは厳密には書式ではないのですが、見出し(TH:)も...
** 実装 [#qc44213e]
525行辺りのwhileを置き換えてみます。
while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR...
$text, $matches)) {
if ($matches[1]) {
$this->style['align'] = 'text-align:' . strtolower($...
$text = $matches[9];
} else if ($matches[3]) {
$name = $matches[2] ? 'background-color' : 'color';
$this->style[$name] = $name . ':' . htmlsc($matches[...
$text = $matches[9];
} else if ($matches[4]) {
$this->style['size'] = 'font-size:' . htmlsc($matche...
$text = $matches[9];
} else if ($matches[5]) {
$this->style['bold'] = 'font-weight:bold;';
$text = $matches[9];
} else if ($matches[6]) {
$this->style['style'] = 'font-style:'.strtolower(htm...
$text = $matches[9];
} else if ($matches[7]) {
$this->style['decoration'] = 'text-decoration:'.strt...
$text = $matches[9];
} else if ($matches[8]) {
$this->tag = 'th';
$text = $matches[9];
}
}
*** ついでにユーザー定義も追加 [#kc0df525]
$line_rules = array(
'COLOR\(([^\(\)]*)\){([^}]*)}' => '<span style="...
'SIZE\(([^\(\)]*)\){([^}]*)}' => '<span style="f...
'COLOR\(([^\(\)]*)\):((?:(?!COLOR\([^\)]+\)\:).)...
'SIZE\(([^\(\)]*)\):((?:(?!SIZE\([^\)]+\)\:).)*)...
'BOLD:((?:(?!BOLD\([^\)]+\)\:).)*)' => '<b>$1</b...
'ITALIC:((?:(?!ITALIC\([^\)]+\)\:).)*)' => '<i>$...
'OBLIQUE:((?:(?!OBLIQUE\([^\)]+\)\:).)*)' => '<e...
'UNDERLINE:((?:(?!UNDERLINE\([^\)]+\)\:).)*)' =>...
'OVERLINE:((?:(?!OVERLINE\([^\)]+\)\:).)*)' => '...
'LINE-THROUGH:((?:(?!LINE-THROUGH\([^\)]+\)\:).)...
'%%%(?!%)((?:(?!%%%).)*)%%%' => '<ins>$1</ins>',
'%%(?!%)((?:(?!%%).)*)%%' => '<del>$1</del>',
"'''(?!')((?:(?!''').)*)'''" => '<em>$1</em>',
"''(?!')((?:(?!'').)*)''" => '<strong>$1</strong...
);
--------
- もし、実装したいならこのようにすると可能です。 -- [[は...
- BOLDとTHは結構違うので、THは[[BugTrack/2531]]に分離しま...
- はいふんさんの実装を参考にして、表組みの BOLD: を対応し...
- 参考実装はBOLD以外のITALIC等も入れていただいてたのです...
#comment
終了行:
* 表組みの書式指定行構文に「太字」の追加 [#o3f40b36]
- ページ: [[BugTrack]]
- 投稿者: [[こん]]
- 優先順位: 低
- 状態: 完了
- カテゴリー: 本体新機能
- 投稿日: 2020-10-23 (金) 22:00:21
- バージョン: 1.5.3
- リリース予定バージョン: 1.5.4
** メッセージ [#xf71cc2f]
現在表組みの書式指定行にサポートされているのは
LEFT:
CENTER:
RIGHT:
BGCOLOR(色):
COLOR(色):
SIZE(サイズ):
の6つだけですが、ここに太字(BOLD:)の追加も希望したいです。
%%また、これは厳密には書式ではないのですが、見出し(TH:)も...
** 実装 [#qc44213e]
525行辺りのwhileを置き換えてみます。
while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR...
$text, $matches)) {
if ($matches[1]) {
$this->style['align'] = 'text-align:' . strtolower($...
$text = $matches[9];
} else if ($matches[3]) {
$name = $matches[2] ? 'background-color' : 'color';
$this->style[$name] = $name . ':' . htmlsc($matches[...
$text = $matches[9];
} else if ($matches[4]) {
$this->style['size'] = 'font-size:' . htmlsc($matche...
$text = $matches[9];
} else if ($matches[5]) {
$this->style['bold'] = 'font-weight:bold;';
$text = $matches[9];
} else if ($matches[6]) {
$this->style['style'] = 'font-style:'.strtolower(htm...
$text = $matches[9];
} else if ($matches[7]) {
$this->style['decoration'] = 'text-decoration:'.strt...
$text = $matches[9];
} else if ($matches[8]) {
$this->tag = 'th';
$text = $matches[9];
}
}
*** ついでにユーザー定義も追加 [#kc0df525]
$line_rules = array(
'COLOR\(([^\(\)]*)\){([^}]*)}' => '<span style="...
'SIZE\(([^\(\)]*)\){([^}]*)}' => '<span style="f...
'COLOR\(([^\(\)]*)\):((?:(?!COLOR\([^\)]+\)\:).)...
'SIZE\(([^\(\)]*)\):((?:(?!SIZE\([^\)]+\)\:).)*)...
'BOLD:((?:(?!BOLD\([^\)]+\)\:).)*)' => '<b>$1</b...
'ITALIC:((?:(?!ITALIC\([^\)]+\)\:).)*)' => '<i>$...
'OBLIQUE:((?:(?!OBLIQUE\([^\)]+\)\:).)*)' => '<e...
'UNDERLINE:((?:(?!UNDERLINE\([^\)]+\)\:).)*)' =>...
'OVERLINE:((?:(?!OVERLINE\([^\)]+\)\:).)*)' => '...
'LINE-THROUGH:((?:(?!LINE-THROUGH\([^\)]+\)\:).)...
'%%%(?!%)((?:(?!%%%).)*)%%%' => '<ins>$1</ins>',
'%%(?!%)((?:(?!%%).)*)%%' => '<del>$1</del>',
"'''(?!')((?:(?!''').)*)'''" => '<em>$1</em>',
"''(?!')((?:(?!'').)*)''" => '<strong>$1</strong...
);
--------
- もし、実装したいならこのようにすると可能です。 -- [[は...
- BOLDとTHは結構違うので、THは[[BugTrack/2531]]に分離しま...
- はいふんさんの実装を参考にして、表組みの BOLD: を対応し...
- 参考実装はBOLD以外のITALIC等も入れていただいてたのです...
#comment
ページ名: