转换脚本
const {exec} = require('child_process') const iconv = require('iconv-lite') let str = ` <style> .search-bar { height: 50px; } </style> ` let arr = [] let str2 = str.replace(/((\-|\+)?\d+(\.\d+)?)px/gim, s => { let px = s.replace('px', '') let px2 = parseFloat(px) * 2 return px2 + 'rpx' }) exec('clip').stdin.end(iconv.encode(str2.trim(), 'gbk')) console.log('===复制成功===', new Date().toLocaleString())
结果
<style> .search-bar { height: 100rpx; } </style>
本文地址
https://www.cnblogs.com/stumpx/p/15161063.html
===