Skip to content

Instantly share code, notes, and snippets.

@mr-gradation
Last active May 26, 2021 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr-gradation/16c5e9fd84495def08063b00769839bb to your computer and use it in GitHub Desktop.
Save mr-gradation/16c5e9fd84495def08063b00769839bb to your computer and use it in GitHub Desktop.
Excelの計算式で作成したHTMLを整形する
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Excelの計算式で作ったやつを変換するやつ</title>
<style>
textarea{
width: 100%;
height: 10em;
}
</style>
</head>
<body>
<p>Excelの計算式で作ったやつを変換するやつ</p>
<div id="app">
<div><textarea v-model="input" v-on:keyup="replaceText" placeholder="ここにペースト"></textarea></div>
<div>↓↓↓↓↓</div>
<div><textarea v-model="output" onfocus="this.select()"></textarea></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
input: "",
output: ""
},
methods: {
replaceText: function(){
this.output = this.input.replace(/"</g, '<').replace(/>"/g, '>').replace(/""/g, '"');
}
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment