Open1

bookmarklet

counterintuitivecounterintuitive

不要な改行を減らすブックマークレット
Teamsのコメントをコピーして他所へ貼り付ける際とか

data:text/html;charset=utf-8,%0D%0A<!DOCTYPE html>%0D%0A<html lang="ja">%0D%0A<head>%0D%0A<meta charset="UTF-8">%0D%0A<title>Converter</title>%0D%0A</head><body>%0D%0A%0D%0A<textarea name="source" id="_source" style="width:48%;min-height:400px;"></textarea>%0D%0A<textarea name="converted" id="_converted" style="width:48%;min-height:400px;"></textarea>%0D%0A%0D%0A%0D%0A<!--%0D%0A<label>TextArea<textarea name="example" id="_textArea" cols="50%" rows="10"></textarea></label>%0D%0A%0D%0A<label>Text<input type="text" id="_text"></label>%0D%0A</p>%0D%0A%0D%0A<p>%0D%0A<label>Option%EF%BC%9A%0D%0A    <select id="_option">%0D%0A    <option value="">Select</option>%0D%0A    <option value="_opt1_">Option 1</option>%0D%0A    <option value="_opt2_">Option 2</option>%0D%0A    <option value="_opt3_">Option 3</option>%0D%0A    </select>%0D%0A</label>%0D%0A</p>%0D%0A%0D%0A<p>%0D%0A<input type="radio" id="_radio1" name="div" value="_radio1_" checked>%0D%0A<label for="_radio1">Radio 1</label><br>%0D%0A<input type="radio" id="_radio2" name="div" value="_radio2_" checked>%0D%0A<label for="_radio2">Radio 2</label><br>%0D%0A<input type="radio" id="_radio3" name="div" value="_radio3_" checked>%0D%0A<label for="_radio3">Radio 3</label><br>%0D%0A</p>%0D%0A-->%0D%0A%0D%0A<script>%0D%0Afunction inputChange(event){%0D%0A    let v = event.currentTarget.value;%0D%0A    let vn = v.replace(/(\r\n){2,}|\r{2,}|\n{2,}/g, '\n');%0D%0A    console.log(v);%0D%0A    document.getElementById('_converted').value = vn;%0D%0A}%0D%0A%0D%0Alet source_ = document.getElementById('_source');%0D%0Asource_.addEventListener('input', inputChange);%0D%0A%0D%0A<!--%0D%0Alet textArea_ = document.getElementById('_textArea');%0D%0AtextArea_.addEventListener('input', inputChange);%0D%0A%0D%0Alet text_ = document.getElementById('_text');%0D%0Atext_.addEventListener('input', inputChange);%0D%0A%0D%0Alet option_ = document.getElementById('_option');%0D%0Aoption_.addEventListener('input', inputChange);%0D%0A%0D%0Alet radio1_ = document.getElementById('_radio1');%0D%0Aradio1_.addEventListener('input', inputChange);%0D%0Alet radio2_ = document.getElementById('_radio2');%0D%0Aradio2_.addEventListener('input', inputChange);%0D%0Alet radio3_ = document.getElementById('_radio3');%0D%0Aradio3_.addEventListener('input', inputChange);%0D%0A-->%0D%0A%0D%0A</script>%0D%0A%0D%0A</body>%0D%0A</html>