Skip to content

[Decomment] 削除線の del tag (strikethrough) 対応#335

Open
shinyonogi wants to merge 2 commits intodevelopfrom
feat/#55_decomment_support_strike_through
Open

[Decomment] 削除線の del tag (strikethrough) 対応#335
shinyonogi wants to merge 2 commits intodevelopfrom
feat/#55_decomment_support_strike_through

Conversation

@shinyonogi
Copy link
Copy Markdown
Collaborator

@shinyonogi shinyonogi self-assigned this Mar 13, 2026
@shinyonogi shinyonogi requested a review from jflute March 27, 2026 13:04
@shinyonogi shinyonogi marked this pull request as ready for review March 27, 2026 13:04
Copy link
Copy Markdown
Collaborator

@jflute jflute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いくつかフィードバック

if (!el) { return; }
el.addEventListener('mousedown', function(e) {
e.preventDefault();
applyFormatting(textarea, btn.syntax);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょとインデントが変

},
/**
* Render strikethrough (~~text~~) as HTML del tags
* @param {string} string - text
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc, 「削除線対象の選択されたテキスト」みたいなニュアンスの説明があると嬉しい。

/**
* Apply formatting syntax around selected text in a textarea.
* If no text is selected, inserts the syntax markers and places the cursor between them.
* @param {HTMLTextAreaElement} textarea
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc, 一応、何かしら説明を書いておいて欲しい。(もう明確なmのではあるかもだけど)

// strip dfalias:{} or shalias:{} from display
var cleanBody = DecommentUtil.removeAliasFromDecomment(decomment.body);
displayComment += cleanBody;
displayComment += DecommentUtil.renderStrikethrough(cleanBody);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今回の修正じゃないかもしれないけど、気づいたらdecomment空っぽのカラムでdecommentダイアログを起動すると、nbsp; が出るようになってしまった。

Image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  とかを取ってきてしまっているのかも?

}
return ""
var html = element.innerHTML.replace(/<span>@author\([^)]*\)<\/span>/g, '').trim();
return html.replace(/<del>([\s\S]+?)<\/del>/g, '~~$1~~');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

複数行をまたいで~~したとき、評価されないっぽい。

Image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

どっちかにしたい。
o 複数行選択で実行した時1行1行ににょろが付くか
o 単純に複数行をまたいでも評価されるようにするか

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants