Hi gordonjohnston,
For now the editor does not support to separate the image/link url format. We suggest you change the link url to the relatively path before you send the mail at server side.
Please try the example below, it shows you how to replace the path of the link(only for <a> target) at server side.
- <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %>
-
- <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- string FilterHref(Match m)
- {
- string href = m.Groups[3].ToString();
- string pre = "http://localhost:14123";
- if (href.StartsWith(pre))
- href = href.Remove(0, pre.Length);
- return "<a " + m.Groups[1] + "href=" + m.Groups[2] + href + m.Groups[4];
- }
-
- protected void b1_Click(object sender, EventArgs e)
- {
- Regex re = new Regex("<a\\s([^>]+\\s)?href\\s?=\\s?([\"']?)([^>\"']+)([\"']?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
- t1.Text = re.Replace(Editor1.Text, new MatchEvaluator(FilterHref));
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CE:Editor ID="Editor1" runat="server" URLType="Absolute">
- </CE:Editor>
- <asp:Button ID="b1" runat="server" Text="save" OnClick="b1_Click" /><br />
- <asp:TextBox ID="t1" runat="server" TextMode="multiLine" Rows="20" Width="800"></asp:TextBox>
- </form>
- </body>
- </html>
The code below use to defined the url which you do not want it in the <a> target. “http://localhost:14123” is my host name.
string pre ="http://localhost:14123";
Regards,
Ken