Having users make posts that have links in them distresses me. I know that usually domain names don’t change very often. Many users are not very savy regarding being able to edit the href code in an <a> tag. What they tend to do is browse to a page in the site, copy the link and then use the <a> tag button when they create a weblog entry. The result is a weblog entry that has a hardcoded domain name rather than a href that uses {site_url} for the domain name.
My idea…Create an extension that would search for the exact string that is contained in the configuration setting that holds the domain name. When it finds it it replaces that text with {site_url} instead of the hardcoded domain name. This way all weblog entries that point internally get the don’t break if the domain name is changed after the entry is created. I suppose that this could be done with any string that contains the same value as the domain name in the configuration settings. <img> tags would also be handy to replace.
Any thoughts? Are there better ways to do this?