Melody Massard
Melody Massard

Reputation: 5

Automating a text change on every html page of a website

I'm using Siteimprove which is a software that looks through a website and recommends accessibility changes. I'm supposed to go through and edit the html of the pages to improve the Siteimprove score.

I'm supposed to add a language attribute to all 143 pages and I was thinking I could write a simple script to go through every html page and replace <html> with <html lang="en-US"> instead of manually do this.

I haven't done this before so I was thinking to make a copy and test a script (I have yet to write). Do you know where I should look for examples to write such a script that would basically say:

"For every file in directory named .html, if it contains <html> replace <html> with <html lang="en-US">"

Or if I should edit my logic statement above? I'm a student worker and don't want to mess this up.

Upvotes: 0

Views: 260

Answers (1)

Melody Massard
Melody Massard

Reputation: 5

Thanks you to those who left comments, I didn't realize replaceAll was an option in VSCode, much easier solution!

Upvotes: 0

Related Questions