I
I
itsjustmypage2016-06-03 15:18:57
HTML
itsjustmypage, 2016-06-03 15:18:57

How to search for specific HTML in multiple .html files?

There is a set of .html files where you need to find and replace some html elements along with the content. How to find them all at once?
I am not strong in regular expressions, but I tried those that I found. The problem is the nesting of identical tags, the search goes up to the first inner

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rd96, 2016-06-04
@edward04

I didn’t quite understand the question, but Sublime text has a folder search and replacement of all identical expressions.
In general, to clarify, then here:
How do you edit a large number of pages of sites with a monotonous code?

L
littleguga, 2016-06-04
@littleguga

I thought about something and did not find a ready-made solution, I decided to write an npm module.
Link to npm.js
Link to github
Usage:
Create an empty folder, in it npm install remove-html-element
then create a file, for example test.js
put the necessary html files in the folder

//test.js
var rem  = require('remove-html-element');
rem('file.html', '#remove-this-selector');

Will remove the block with id "remove-this-selector" in file.html and overwrite the new content in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question