mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu v1.4.3 Funium
This commit is contained in:
+24
-1
@@ -24,6 +24,29 @@ for( $i=0;$i<$cnt;$i++ ){
|
||||
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||
}
|
||||
|
||||
function processMarkdownRules($markdownText) {
|
||||
|
||||
// コード(#code)をHTMLのdiv class="code"タグに変換
|
||||
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
|
||||
|
||||
// 画像(#img)をHTMLのimgタグに変換
|
||||
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
|
||||
|
||||
// タイトル(#、##、###)をHTMLのhタグに変換
|
||||
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
|
||||
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
|
||||
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
|
||||
|
||||
// 箇条書き(-)をHTMLのul/liタグに変換
|
||||
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
|
||||
|
||||
// 空行の前に何もない行をHTMLのpタグに変換
|
||||
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
|
||||
|
||||
return $markdownText;
|
||||
}
|
||||
|
||||
|
||||
function release_only_markdown($markdownText) {
|
||||
|
||||
// リリースノートの項目わけ
|
||||
@@ -42,7 +65,7 @@ $htmltext = ''; // 初期化
|
||||
|
||||
foreach ($srelease as $release) {
|
||||
$markdowntext = $release;
|
||||
$convertedText = processMarkdownAndWrapEmptyLines(release_only_markdown($markdowntext));
|
||||
$convertedText = processMarkdownRules(release_only_markdown($markdowntext));
|
||||
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user