Aiming to convert first row of a html table from to tags.
So, I wrote the following code.
(defun tdtoth () (if (search-forward "</tr>" nil t) (while (search-forward "td" nil t) (replace-match "th" 1))))
And executed it while I was on in the following text:
<tr> <td> Some text </td> <td> Another thing </td> </tr>
The idea being search for
</tr> only once and while that is not happening, replace every
But that code does not work. What is wrong and how do I set it right?