|
From: Olivier S. <ol...@bl...> - 2019-09-18 16:42:18
|
On 18-09-19 11:25, William Highton wrote:
> Hello Olivier
> Thank you for looking at this. I have attached a
> page from the website (I am working on my hard drive, not on the remote
> server) that requires the changes. I first tried to change the whole
> paragraph:-
>
> ---------------------------------------------------------------------------------------------------
> <p><span class="fl">
>
> <script>
> <!--
> function initArray() {
> this.length = initArray.arguments.length
> for (var i = 0; i < this.length; i++)
> this[i+1] = initArray.arguments[i]
> }
>
> var MonthOfYearArray = new initArray("January","February","March","April",
> "May","June","July","August",
>
> "September","October","November","December");
>
> var LastModifiedDate = new Date(document.lastModified);
> var correctyear=LastModifiedDate.getYear()
>
> if(correctyear<2000)
> {
> correctyear = correctyear + 1900
> }
>
> document.write("Copyright © ");
> document.write(correctyear);
> document.write(" CHEMANDY ELECTRONICS Ltd<br>");
> document.write(" Page last modified ");
> document.write(MonthOfYearArray[(LastModifiedDate.getMonth()+1)]," ");
> document.write(LastModifiedDate.getDate(),", ",(correctyear));
> //-->
> </script>
> </span></p>
> </div><br>
>
> ------------------------------------------------------------------------------------------------------
>
> This was an attempt to remove "<span class="fl">" and "</span>" in a
> couple of hundred pages, but it refused to function. I then tried to
> remove the "<span class="fl">" on its own and that worked. On testing
> it, I found that "document.write(" CHEMANDY ELECTRONICS Ltd<br>");"
> needed some none breaking spaces which again was changed successfully
> and was changed to "document.write("
> CHEMANDY ELECTRONICS Ltd<br>");". However, neither of these
> changes indicated the correct number of pages changed in the /find and
> replace box/, but did bring up a list of the pages changed.
ok, so the bug is related to replace in multiple files. I'll have a look
again.
> Repeated attempts to change:-
>
> </script>
> </span></p>
> </div><br>
>
>
> by removing "</span>" failed.
>
> </script>
> </p>
> </div><br>
>
> There is something in these three lines that the search does not like. I
> am loath to try any simplification of the search because it could wreak
> havoc on the whole website.
it looks like these pages were created with a windows editor, instead of
just newlines, they contain newlines and cariage returns. So they
probably only match on this pattern:
</script>\r\n</span></p>\r\n</div><br>
a way to handle this could be to use a regex pattern so it will match on
any combination of newlines or carriage returns:
</script>[\r\n]*</span></p>[\r\n]*</div><br>
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
|