clear-duplicates.sh 837 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # 清理field-management-content.html中的重复样式
  3. # 作者: AI助手
  4. # 日期: 2024年5月
  5. file="pages/field-management-content.html"
  6. echo "正在处理: $file"
  7. # 1. 移除重复的position定义
  8. sed -i '' 's/position: relative;[[:space:]]*position: relative;/position: relative;/g' "$file"
  9. # 2. 移除重复的white-space定义
  10. sed -i '' 's/white-space: nowrap;[[:space:]]*white-space: nowrap;/white-space: nowrap;/g' "$file"
  11. # 3. 移除重复的overflow/text-overflow定义
  12. sed -i '' 's/overflow: hidden;[[:space:]]*text-overflow: ellipsis;[[:space:]]*overflow: hidden;[[:space:]]*text-overflow: ellipsis;/overflow: hidden;\n text-overflow: ellipsis;/g' "$file"
  13. # 4. 移除重复的max-width定义
  14. sed -i '' 's/max-width: 200px;[[:space:]]*max-width: 200px;/max-width: 200px;/g' "$file"
  15. echo "完成处理"