Last active
May 26, 2021 04:36
-
-
Save mr-gradation/16c5e9fd84495def08063b00769839bb to your computer and use it in GitHub Desktop.
Excelの計算式で作成したHTMLを整形する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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