Notes on miscellaneous stuff

13:55 04 September 2025
From notes of past few days:

Copy-paste numbered list from HTML to text preserving the numbers

Seems like there is no direct way to do that. Checked with ChatGPT - its suggestions did not work.
Free online utilities to convert HTML to text are around but they did not provide numbers and line separation.

Solution: Copy-paste numbered list from HTML page in browser to https://onlinetexttools.com/add-line-numbers . This will add the list without numbers but as separate lines in the input box. The 'Numbered Text Lines' box will have the content with the numbers which can be copied to clipboard after a delay of some seconds followed by providing permission to copy to clipboard.

[Later update: Another solution is to ask an AI chatbot to do it. But that will need creating a simple but unambiguous prompt which I can save for later reuse.]
---------------------

==========================

Excluding folder (or file) in .gitignore that has been committed to repo

Me: I want to exclude dist folder in my .gitignore. I added the entry (see uploaded file) but VSCode does not show dist as ignored folder (not gray colour).

Gem or ChatGPT don't recall which: .. 
The reason VS Code is not showing the dist folder as ignored is because the .gitignore file only affects files and folders that have not yet been committed to your Git repository.
If the dist folder was created and committed to your repository before you added dist to your .gitignore file, Git will continue to track it. VS Code, in turn, will continue to show it as a tracked directory, and its contents will not appear in gray.
To fix this, you need to tell Git to stop tracking the dist folder. You can do this with a two-step process:

Stop Tracking the Folder: Use the git rm --cached command to remove the folder from the Git index.
git rm -r --cached dist

rm: The "remove" command.
-r: The "recursive" flag, which tells Git to remove the folder and everything inside it.
--cached: This is the crucial flag. It tells Git to only remove the folder from the repository's index (its tracking list), but to leave the actual files on your local file system.

Commit the Change: Now you need to commit this change to your repository. This will tell Git that from now on, it should ignore the dist folder.

git commit -m "Remove dist folder from tracking"
After you run these two commands, you will see that the dist folder and its contents are no longer tracked by Git. You will also notice that VS Code now shows the folder name in gray, as you expected, indicating that it is being correctly ignored.

Me: That fixed it though I had to close and reopen VSCode for dist to be shown as gray.
================================

Blogger seems to trip up on <wbr> tag; Blogger shows 'invalid' HTML in red

20:30 06 September 2025
In https://raviswdev.blogspot.com/2025/09/vscode-extension-to-auto-add-id.html , when I would go to HTML view and then try to go back to Compose view without making any changes, I would be shown an error message that HTML is invalid and switching to Compose view may lead to loss of some data (paraphrasing).
At first, I could not figure out the exact issue and also how to identify the tags that Blogger is complaining about. Later i saw that Blogger was showing </wbr> tags in red and some other tags that contained it like </div> in red. [Note that I had figured that out using W3C validation service and fixed it but ... see update] Removing all the </wbr> tags fixed the issue. Apparently <wbr> alone is enough and one does not need <wbr></wbr>. Even W3C validation service pointed that out but it pointed some other issues too (like <br /> instead of <br>) which Blogger does not seem to complain about (and probably uses).

Update: After saving the post and then going back to HTML view mode, Blogger seems to have inserted the </wbr> tags itself, and now complains about it! The solution was to simply remove all <wbr> tags as well (so not <wbr><wbr/> tags in the post). That fixed the issue. Now I can switch between Compose and HTML view without any error messages from Blogger.

========================

Comments