Generating html links from plain text

How can I scan a text (a String) and add links when a word is an URL?
I tried the following which works but it's too slow:
  String text = rs.getString("text");         
                text2scan=text.split("[\n ]")
                for(int i = 0; i < text2scan.length; i++){
                    String replacement = null;
                    String word = text2scan;
log.info(word);
if(word.indexOf(".com")!=-1){
replacement="<a href=\""+word+"\">"+word+"</a>";
text=text.replaceAll(word, replacement);
text=text.replaceAll("www","http://www");
text=text.replaceAll("http://http://","http://");
text=text.replaceAll(">http://",">");
Isn't this already implemented somewhere?
Thanks
Niklas

Because I was semi interested by this issue, and how best to solve it, heres a quick and dirty example program.
It does a very basic job, but should be pretty much equivalent to what you had originally.
package mypackage;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexpMakeHyperlinks {
      * Loads a file into a StringBuffer
      * @param f File to read
      * @return StringBuffer with contents of text file.
      * @throws IOException
     public StringBuffer loadFile(File f) throws IOException {
        System.out.println("Reading file " + f.getAbsolutePath());
          BufferedReader in = new BufferedReader(new FileReader(f));
          StringWriter sw = new StringWriter();
          PrintWriter pw = new PrintWriter(new BufferedWriter(sw));
          String line = null;
          while ((line = in.readLine()) != null) {
               pw.println(line);
          pw.flush();
          in.close();
          return sw.getBuffer();
      * Writes the contents of a StringBuffer to file
      * @param f File to write to
      * @param sb Text to write to file
      * @throws IOException
     public void writeToFile(File f, StringBuffer sb) throws IOException{
          System.out.println("Outputting to " + f.getAbsolutePath());
          BufferedReader in = new BufferedReader(new StringReader(sb.toString()));
          PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
          String line = null;
          while ((line = in.readLine()) != null) {
               out.println(line);
          out.flush();
          in.close();     
      * Converts all urls like "www.google.com" into hyperlinks in the text.
      * @param initialText The text to convert
      * @return Converted text.
     public StringBuffer convertText(StringBuffer initialText) {
          StringBuffer result = new StringBuffer(initialText.length());          
          Pattern p = Pattern.compile("(href=\")?(http://)?www\\..*?.com\\b");
          Matcher m = p.matcher(initialText);
          while (m.find()) {
               String href = m.group();
               // ignore links that are already hyperlinks
               if (href.startsWith("href")){
                    continue;
               // add on the http:// if necessary
               if (!href.startsWith("http://")) {
                    href = "http://" + href;
               // add the new text into the output.
               m.appendReplacement(result, "<a href=\"" + href + "\">" + href + "</a>");
          m.appendTail(result);
          return result;
      * Testing method for experimenting with the patternmatching
      * @param text
     public void matchLink(String text) {
          System.out.println("Analyzing text " + text);
          Pattern p = Pattern.compile("(http://)?www\\..*?.com\\b");
          Matcher m = p.matcher(text);
          while (m.find()) {
               System.out.println("Found: " + m.group());
     public static void main(String[] args) {
          RegexpMakeHyperlinks hyper = new RegexpMakeHyperlinks();
          String[] testStrings = { "www.google.com", "www.myspace.net", "make sure you visit www.yahoo.com for details", "Two sites: http://www.java.com and http://www.javabeans.com" };
          for (int i = 0; i < testStrings.length; i++) {
               hyper.matchLink(testStrings);               
          System.out.println();
          System.out.println("----------------------------");
System.out.println();
File inFile = new File("makeHyperlinkTest.txt");
File outFile = new File("makeHyperlinkTest.output");
try{
StringBuffer sb = hyper.loadFile(inFile);
StringBuffer result = hyper.convertText(sb);
hyper.writeToFile(outFile, result);
catch(Exception e){
     System.out.println("Error " + e.getMessage());
     e.printStackTrace(System.out);      
And a test file makeHyperlinkTest.txt
This file just contains plain text with hyperlinks to places like www.google.com and http://www.yahoo.com.
The program I have written will convert these links like www.google.com into hyperlinks for displaying as html.
Make sure you visit http://www.java.sun.com and read all about Java.
And if I already have an <a href="www.google.com">Hyperlink</a> in this file it should leave it alone right?

Similar Messages

  • KNOWN ISSUE: HTML Messages with plain-text signatures

    To get around the EAS security policy issue, I'm having non-sensitive emails from work forwarded to a GMail account from a redirect set up in our corporate OWA. The redirect seems to send the messages to GMail without any issues; formatting is 100% intact, and in the GMail web client as well as Thunderbird, Entourage, etc., HTML emails with plain-text signature attachments show the plain-text message inline with the rest of the formatted message. All of our internal mailing lists have these plain text attachments that say where the message was coming from (Message sent from [email protected] by listserv). These get affixed to every message, both plain text and HTML.
    Here's my problem: The Pre's email client handles both plain text and HTML messages beautifully. But, when I receive a message from a mailing list with a plain text attachment, the HTML portion disappears, and all I see is the signature.
    Is there any way to make the Pre show the HTML INSTEAD of the plain text? I can live without the sig, I know where the messages are coming from already. But if I can't read the message, it's useless. I've only begun researching this and so far Google hasn't been much help, nor has searching these or other forums. Any help would be appreciated.
    Palm Pre P100EWW
    Post relates to: Pre p100eww (Sprint)
    Message Edited by HowellBP on 06-16-2009 04:13 PM

    1-51626418773
    I just got off the phone with Palm Support. Apparently this is a bug in the mail application. It currently does not support parsing both HTML and plain text in the same message. It will read EITHER plain text OR HTML, but not both at the same time. This will be fixed in a future update.

  • Help Please - having difficulties creating af link from the text to an attached file i acrobat

    I have been reading the help, but it just wonn't work when I try.
    I have tried as followed (I am working with a danish version, and hope to matched the same word as in the english version of Acrobat Xpro):
    1. From the toolbox i choose content and then 'hyperlink'
    2. I mark the text from which i wish to make a link
    3. Acrobat respond with an popup picture 'create a link'
    4. From the popup I mark 'Open a side' and push 'next'
    5. Acrobat respond with a new popup picture 'create / go to a side'
    6. I go to the navigator and open the list with attached file's that I have embedded in my acrobat file.
    7. I mark the to which i wish to make a link to
    8. In the popup 'create / go to a side' that stilll is open, i push 'Mark hyperlink'
    Then I hoped that I have created a link from the acrobat text to the attached file. In stead Acrobat has made a link to the same sidenumber that respond to the text from which i wish to make a link . F.ex. the linktext is on side 10 - then the link goes to side 10.
    How do i do it right?
    Please help.

    Hello Bernd
    Thanks for a quick respond.
    This corresponds to the text I have tried myself, but apparently I do something wrong
    1.      Open a PDF that contains a PDF file attachment – done
    2.      Go to where you want to create a link. If that location is in the file attachment, click the Attachments button in the navigation pane, select the file attachment, and click open.
    Here I go to side number 10 from which I wish to make a link from (I am not open the attachment file at this moment, as the location not is inside the file attachment).
    (I earlier also tried to  mark the attachment file and click open, and It result that the attached file just opened normally without creating a link to the file).
    3.      Choose Tools > Content > link, and select the area for the link
    Here  I mark the text on side 10 from which I wish to make a link to a attached file
    4.      In the Create Link dialog box, set the link appearance, select Go To A Page View, and then click Next
    Here I have selected ‘Go to a page view’ as told and I click Next
    5.      Set the page number and view magnification you want, either in the parent PDF document or in the file attachment, and then click set link.
    Here I go to the navigation pane and mark the attached file from the file list (the files in the list hasn’t any side number in the list) and then I click Set Link.
    Then I hoped that I have created a link from the acrobat text to the attached file. In stead Acrobat has made a link to the same sidenumber that respond to the text from which i wish to make a link . F.ex. the linktext is on side 10 - then the link goes to side 10.
    What do I do wrong.?
    Med venlig hilsen
    Mogens Pedersen
    Specialkonsulent
    T 33 63 13 07
    F 33 63 10 11
    [email protected]<mailto:[email protected]>
    Fra: Bernd Alheit [email protected]
    Sendt: 2. marts 2012 13:11
    Til: Mogens Pedersen
    Emne: Help Please - having difficulties creating af link from the text to an attached file i acrobat
    Re: Help Please - having difficulties creating af link from the text to an attached file i acrobat
    created by Bernd Alheit<http://forums.adobe.com/people/Bernd+Alheit> in Creating, Editing & Exporting PDFs - View the full discussion<http://forums.adobe.com/message/4241290#4241290

  • Remove HTML tags from a text area

    Hi, here is my problem:
    I have a form with a text area item; this item is “Display as Editor HTML standard”. So it is possible to enter formatted text with tags HTML. Then I save the text in a table. In the column the text maintain the HTML tags. Afterwards I can put the text in a report, and I can see the formatted text with the tags HTML interpreted.
    But I need also to use that text for other aims, (i.e. sending it in a mail) with the html tags removed.
    Is there any way to remove HTML tags from a text item?
    Regards
    Dario

    From http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:769425837805
       FUNCTION str_html (line IN VARCHAR2)
          RETURN VARCHAR2
       IS
          x         VARCHAR2 (32767) := NULL;
          in_html   BOOLEAN          := FALSE;
          s         VARCHAR2 (1);
       BEGIN
          IF line IS NULL
          THEN
             RETURN line;
          END IF;
          FOR i IN 1 .. LENGTH (line)
          LOOP
             s := SUBSTR (line, i, 1);
             IF in_html
             THEN
                IF s = '>'
                THEN
                   in_html := FALSE;
                END IF;
             ELSE
                IF s = '<'
                THEN
                   in_html := TRUE;
                END IF;
             END IF;
             IF NOT in_html AND s != '>'
             THEN
                x := x || s;
             END IF;
          END LOOP;
          RETURN x;
       END str_html;There's also a reqular expression approach that I've not tried. Remove HTML Tags and parse the text out of it

  • How can I eliminate HTML tags from Oracle Text Snippet?

    I perform a search on many tables and on many columns of those tables.
    Some of those columns are VARCHAR2 and some CLOB.
    Also, some of the searchable data are HTML and some are plain text.
    My problem is that ctx_doc.snippet fetches the HTML tags.
    For example I get this, as a snippet result in one of my searches: Qual Germany n1 &lt;p&gt;Test Qual Germany n1&lt;/p&gt;
    I want the result to be fetched without the HTML tags.
    In my index configuration I have used NULL FILTER and HTML_SECTION_GROUP.With that configuration I managed to eliminate the HTML tags but not in all cases!
    For example:
    I search table CONTENTS columns TITLE(VARCHAR2) and MAIN_TEXT(CLOB)
    I created the following procedure that concatenates the two columns:
    CREATE OR REPLACE PROCEDURE CONTENTS_PROC( p_id in rowid, p_lob IN OUT clob)
    IS
    BEGIN
    FOR c1 IN (SELECT main_text||' '||title data FROM contents WHERE ROWID = p_id)
    LOOP
    dbms_lob.copy( p_lob, c1.data,
    dbms_lob.getlength( c1.data ));
    END LOOP;
    END;
    I created a user Datastore:
    BEGIN
    ctx_ddl.create_preference( 'content_trans_datastore', 'user_datastore' );
    ctx_ddl.set_attribute( 'content_trans_datastore', 'procedure', 'CONTENTS_PROC' );
    END;
    and finally I create the index:
    CREATE INDEX content_trans_ot_idx ON contents(ORACLE_TEXT_COLUMN)
    INDEXTYPE IS ctxsys.CONTEXT PARAMETERS ('datastore content_trans_datastore SYNC(ON COMMIT) STORAGE INDEX_STORAGE filter ctxsys.null_filter section group ctxsys.html_section_group');
    When I perform the search on those data: &lt;p&gt; &lt;strong&gt;Test Doc-Test &lt;/strong&gt; &lt;/p&gt; the snippet I get is: Test Doc-Test.
    That's fine, the html tags are removed!
    In another case I search table NCP columns NAME(VARCHAR2) and BODY(VARCHAR2)
    I created the following procedure that concatenates the two columns:
    CREATE OR REPLACE PROCEDURE NCP_PROC( p_id in rowid, p_lob IN OUT clob)
    IS
    BEGIN
    FOR c1 IN (SELECT name||' '||body data FROM ncp WHERE ROWID = p_id)
    LOOP
    dbms_lob.copy( p_lob, c1.data,
    dbms_lob.getlength( c1.data ));
    END LOOP;
    END;
    I created a user Datastore:
    BEGIN
    ctx_ddl.create_preference( 'ncp_trans_datastore', 'user_datastore' );
    ctx_ddl.set_attribute( 'ncp_trans_datastore', 'procedure', 'NCP_PROC' );
    END;
    and finally I create the index:
    CREATE INDEX ncp_trans_ot_idx ON ncp(ORACLE_TEXT_COLUMN)
    INDEXTYPE IS ctxsys.CONTEXT PARAMETERS('datastore ncp_trans_datastore SYNC(ON COMMIT) STORAGE INDEX_STORAGE filter ctxsys.null_filter section group ctxsys.html_section_group');
    When I perform the search on those data: test &lt;strong&gt; &lt;/strong&gt;http://deleteme.com the snippet I get is: test &lt;strong&gt; &lt;/strong&gt;http://deleteme.com!!!!!!!!!!
    How is this possible? Why in the first case the HTML tags are eliminated and in the second case they are not?
    Thanks,
    Margarita
    Edited by: user13312701 on 07-Sep-2010 08:51

    Doing various tests I found out that the problem is when I need to search in multiple columns of a table.
    That is when I create a user_datastore that uses a procedure that concatenates the columns.
    And especially when the data with the html tags is in a VARCHAR2 column.
    e.g
    --create the table*
    CREATE TABLE CONTENT_TRANS (content_trans_id NUMBER,
    main_text CLOB,
    title vARCHAR2(2000),
    oracle_text_column VARCHAR2(1));
    alter table "CONTENT_TRANS" add constraint CONTENT_PK primary key("CONTENT_TRANS_ID") ;
    --Insert dummy data*
    Insert into CONTENT_TRANS
    (CONTENT_TRANS_ID,MAIN_TEXT,TITLE)
    values
    (1,'lorem','lorem <p>qualification</p> 2.1 ');
    Insert into CONTENT_TRANS
    (CONTENT_TRANS_ID,MAIN_TEXT,TITLE)
    values
    (2,'lorem','lorem <br>qualification</br> 2.1 ');
    --CREATE THE procedure that concatenates main_text(CLOB) and title(VARCHAR2)*
    CREATE OR REPLACE PROCEDURE CONTENT_TRANS_PROC( p_id in rowid, p_lob IN OUT clob)
    IS
    BEGIN
    FOR c1 IN (SELECT main_text||' '||title data FROM content_trans WHERE ROWID = p_id)
    LOOP
    dbms_lob.copy( p_lob, c1.data,
    dbms_lob.getlength( c1.data ));
    END LOOP;
    END;
    --Create the user datastore*
    BEGIN
    ctx_ddl.create_preference( 'content_trans_datastore', 'user_datastore' );
    ctx_ddl.set_attribute( 'content_trans_datastore', 'procedure', 'CONTENT_TRANS_PROC' );
    END;
    --Create the index*
    CREATE INDEX content_trans_ot_idx ON content_trans(ORACLE_TEXT_COLUMN)
    INDEXTYPE IS ctxsys.CONTEXT PARAMETERS ('datastore content_trans_datastore SYNC(ON COMMIT) filter ctxsys.null_filter section group ctxsys.html_section_group');
    exec ctx_doc.set_key_type('PRIMARY_KEY');
    --Perform the query
    SELECT SCORE(1),ct.content_trans_id, ctx_doc.snippet('content_trans_ot_idx', ct.content_trans_id, 'lorem') as snippet
    from content_trans ct
    where contains(ct.ORACLE_TEXT_COLUMN, 'lorem', 1) > 1;
    Results WITH NOT WANTED HTML TAGS:
    6     1     <b>lorem</b> <b>lorem</b> &lt;p&gt;qualification&lt;/p&gt; 2.1
    6     2     <b>lorem</b> <b>lorem</b> &lt;br&gt;qualification&lt;/br&gt; 2.1
    Edited by: user13312701 on 13-Oct-2010 01:18

  • Firefox 11 beta is having issues loading Flash and HTML content, shows plain text instead of images

    I'm not sure what is causing the problem but it has been happening since beta 10 and now its also in beta 11. Randomly when I load any web page the page is displayed in plain text leaving all the HTML or flash content blank. Yes I have the most recent version of flash installed along with Java just in case it was looking for that mess as well. Sometimes the pages load fine, and sometimes they don't, it's like playing lotto with the internet. The only fix I know of is to either keep refreshing the page and "hope" it catches it on the reload, or closing Firefox and running CCleaner. Some times FF will load some of the visual data and leave gaps but usually its just basic text mode. I'm at a loss as to whether the problem is from Firefox or my ISP being a douche, either way its annoying that Firefox is not showing internet pages like it used to.
    Hate to see it happening but it looks like Firefox is on its way to being just another Internet Explorer clone (failure). Should have stayed with your original team, all the new folks you have hired are really mucking up the whole project and its goal of a free and open internet. Not to mention writing bad code and costing you money and more importantly the user base.
    (Update, now it's not doing it go figure, but I'm sure it will do it again at some point, perhaps its not Firefox and something else, I'll keep my eye on it and try to report any findings)

    If you use extensions (Tools > Add-ons > Extension) like <i>Adblock Plus</i> or <i>NoScript</i> or <i>Flash Block</i> that can block content then make sure that such extensions aren't blocking content.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How do you set email so that it is in html instead of plain text on ATT email?

    I would like to view my emails in html but do not know how to change it off of the current settings where it always displays it in plain text. I have att yahoo email.

    The Alt attribute isn't meant to show as a tooltip on hover.
    The Alt attribute is meant to show if the image isn't or can't be displayed.
    The title attribute is meant to show if you hover an image or link.
    *http://kb.mozillazine.org/Image_tooltips_do_not_work
    Some extensions can interfere and disable the tooltip.
    * [[Troubleshooting extensions and themes]]
    * http://www.w3.org/TR/html401/struct/global.html#title title
    * http://www.w3.org/TR/html401/struct/objects.html#alternate-text
    *Popup ALT Attribute: https://addons.mozilla.org/firefox/addon/1933

  • HTML link from external html page to link to a frame in swf

    Hi
    I am trying to set up something to should be fairly basic to
    do .. but I cannot get it to work.
    Need a link from another website to link to a frame label or
    number in my flash movie.
    Something like this ..
    <a href="mySwfPage.php?label=labelnamehere&">Click
    here</a>
    My guess it will not work because I have several stop
    functions and a preloader in the 1st frame not allowing the href
    link to jump to the frame name I want.
    Here is the page I am trying to apply this to -
    http://www.mloudesign.net/tampico/index.html
    We need for an external link to link to the espanol label so
    that would start first, otherwise the english version plays 1st.
    In case this helps this is the preloader I am using in frame
    #1 ..
    onClipEvent (load) {
    total = _root.getBytesTotal();
    onClipEvent (enterFrame) {
    loaded = _root.getBytesLoaded();
    percent = int(loaded/total*100);
    text = percent+"%";
    gotoAndStop(percent);
    if (loaded == total) {
    _root.gotoAndPlay(2);
    Any help would be much appreciated.
    Thanks!
    ~mlou

    he! I'm not alone in my desperation. Take a look at my problem:
    I've got a JEditorPane (not editable) inside a JFrame. The JEditorPane is loaded with the HTML text and all the links to anchors are working properly when I click on them.
    BUT
    If I try to go to an anchor from outside this JFrame I can see how the JEditorPane scrolls to the right anchor and suddenly it scrolls back to the place where the caret was located!!!
    The "funny thing" is that my code is working in jdk1.3.1 but this is happening in jdk1.4.2. Is it a bug?!?!?!
    How could I figure out what position I have to set the caret to for every anchor in order to get the scroll working correctly???
    My implementation of hyperlinkUpdate (working properly, here isn't the problem):
       jEditorPane.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
              MiEditorPane src = (MiEditorPane)e.getSource();
              src.goToAnchor(e.getDescription().substring(1));
        });My object jEditorPane is an instance of this class:
      class MiEditorPane extends JEditorPane {
        MiEditorPane() {
          super();
        public void goToAnchor(String anchor) {
          super.scrollToReference(anchor);
      }And this is the method I call from outside the JFrame containing the JEditorPane:
      public void goToAnchor(String anchor) {
         jEditorPane.goToAnchor(anchor);
      }Any help greatly appreciated ...

  • How to go to anchor html link from external html page in JEditorPane

    Hi people,
    I've been trying to jump to an anchor link from an external html page in JEditorPane, and I cannot get it working, I'm sure it can be done somehow...
    The HTML page has a link like:
    Hello
    and this is loaded into JEditorPane ok.
    The HyperlinkListener implementation:
    public void hyperlinkUpdate( HyperlinkEvent e )
    try {
    if ( e.getEventType() == HyperlinkEvent.EventType.ACTIVATED )
    editorPane_.setPage( getClass().getResource(
    MyDialog.this.getBaseURL().concat( e.getURL().getFile().substring(
    e.getURL().getFile().lastIndexOf( "/" ) + 1 ) ) ) );
    if ( e.getURL().getRef() != null )
    editorPane_.scrollToReference( e.getURL().getRef() );
    else return;
    } catch ( IOException ioe ) { ioe.printStackTrace(); }
    This code loads the new html file ok, but it does not scroll to the anchor. The MyDialog.this.getBaseURL() just returns something like com.name.package, I construct the URL by using this base url and the name of the html file to open.
    ANy help, thanks

    he! I'm not alone in my desperation. Take a look at my problem:
    I've got a JEditorPane (not editable) inside a JFrame. The JEditorPane is loaded with the HTML text and all the links to anchors are working properly when I click on them.
    BUT
    If I try to go to an anchor from outside this JFrame I can see how the JEditorPane scrolls to the right anchor and suddenly it scrolls back to the place where the caret was located!!!
    The "funny thing" is that my code is working in jdk1.3.1 but this is happening in jdk1.4.2. Is it a bug?!?!?!
    How could I figure out what position I have to set the caret to for every anchor in order to get the scroll working correctly???
    My implementation of hyperlinkUpdate (working properly, here isn't the problem):
       jEditorPane.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
              MiEditorPane src = (MiEditorPane)e.getSource();
              src.goToAnchor(e.getDescription().substring(1));
        });My object jEditorPane is an instance of this class:
      class MiEditorPane extends JEditorPane {
        MiEditorPane() {
          super();
        public void goToAnchor(String anchor) {
          super.scrollToReference(anchor);
      }And this is the method I call from outside the JFrame containing the JEditorPane:
      public void goToAnchor(String anchor) {
         jEditorPane.goToAnchor(anchor);
      }Any help greatly appreciated ...

  • URLRequest and navigateToURL to open email client but HTML email, not plain text???

    I want users to click a button that uses URLRequest and navigateToURL to open the user's default email client with email body pre-populated with HTML email.
    Even though I have tried to set the contentType property to one of the following, the HTML tags always display:
    application/xml
    application/html
    var request:URLRequest = new URLRequest("mailto: ?subject=Test Email&body=<h1>Test Body</h1>");request.contentType = "multipart/form-data";
    navigateToURL(request, "_self");
    BTW, the above code is simplified, so I am using escape() on the subject and body text, etc.
    So, is there any way to use mailto in this way to open the default email client and pre-populate with HTML email but not see the tags (BUT NOT REVERT TO PLAINTEXT)?

    FTQuest wrote:
    @Jason
    >The problem there however is that very few people actually set this up... (default mail client)
    Jason, can I ask you: is it your assumption, or there is/was reliable polling showing that majority of users prefer manually go the mail server instead of using the mail client application of their choice - Outlook, FireBird, Mail, etc?
    Igor Borodin
    There are numerous reasons behind avoiding mailto links in relation to design. And it's been debated back and forth for years. Form vs Mailto link both have their pros and cons and intended usages.
    After panelling groups of individuals for three seperate projects regarding various design perspectives in the RIAs we developed, it became quickly apparent that on numerous occasions users clicking a mailto link were unaware of what the resulting screen was actually for. Several had never set up the default mail client on their pc. Many thought that "Yahoo" was the only email service in the world... Now, with that said, the target demographic for those applcations may or may not be what his, yours, or anyone's project may be. The key there is going to be identifying your dedmographic and determining the tech prowness. Also, what exactly is the email's intended result? Refer a friend style? Might be better handled through a web form due to the possiblity of being able to properly track how many referrals were actually made. How many resulted in a visitor. Simply notifying admin that there is a problem on the site? Might be better to fire off a mailto.
    Reliably sending a preformatted HTML email can only be guaranteed on the server side. Otherwise, you run into problems just like he is having here. Now, if the email is plain text, different story.
    Again, it all comes down to identifying your usage and properly utilizng the available tools.

  • "Send link" inserts plain text into an email instead of a hyperlink. How do I correct this?

    I got a new computer and installed Firefox. Previously, when is sent a link to a website, the URL automatically pasted as a hyperlink. Now it shows up as plain text requiring the recipient of my email to cut and paste the URL into his browser.
    How do I fix this?

    There is usually a toolbar button in the editor to turn a text link into a clickable hyperlink (look for a chain like button).<br />
    You can select the text and click that button to turn the link into a clickable hyperlink.<br />
    If you can't find the button then hover them all to check the tooltip of each.<br />
    <br />
    * Make Link - https://addons.mozilla.org/firefox/addon/142<br />

  • How to make html file from a text field data

    hi!
    I want to know how to make a file with .html extension and the data in this file should be from a text field. like i want to enter some thing in a text area and have to place it in a file on server side in html formate.

    so you told us what you want, but what is your question?

  • Regular Expressions for converting HTML to Structured Plain Text

    I'm writing a PL/SQL function that will convert HTML to plain text, but still preserve some of the formatting/line breaks. One of my challenges is in writing a regular expression to capture the text blocks while ignoring the markup. I'm trying to write an expression that will grab all of the text between start/end tags, but discard the tags. For example, to find all of the text between a start/end paragraph, I want to do something like:
    REGEXP_REPLACE('&lt;p style=&quot;text-align:center&#59;&quot;&gt;This is the body of the paragraph&lt;/p&gt;', '&lt;p.*&gt;(.*)&lt;/p&gt;', '\1||v_crlf' )
    where \1 returns the contents of the paragraph and v_crlf (declared earlier in the function) inserts a line break. I know there are more general expressions that will remove all tags, but I want to specifically identify the tags so I can process them appropriately. This way I can easily convert HTML to plain text for email and reporting without having to keep two versions around. Any help would be greatly appreciated. Once I get this worked out, I will repost with the function code for others to use. Thanks.
    Edited by: jritschel on Oct 26, 2010 9:58 AM

    Here's a function I wrote for an app. I'm not making in promises on it's accuracy as the app was just a proof of concept and never made it to production.
    function strip_html( p_clob in clob )
    return clob
    is
        l_out clob;
        l_test  number := 0;
        l_max_loops constant number := 20;
        i   pls_integer := 0;
    begin
        l_out := regexp_replace(p_clob,'<br>|<br />',chr(13)||chr(10),1,0,'imn');
        l_out := regexp_replace(l_out,'<p>',chr(13)||chr(10),1,0,'imn');
        l_out := replace(l_out,'<li>',chr(13)||chr(10)||'*<li>');
        l_out := regexp_replace(l_out,'<b>(.+?)</b>','*\1*',1,0,'imn');
        l_out := regexp_replace(l_out,'<u>(.+?)</u>','_\1_',1,0,'imn');
        loop
            l_test := regexp_instr(l_out,'<([A-Z][A-Z0-9]*)[^>]*>.*?</\1>',1,1,0,'imn');
            exit when l_test = 0 or i > l_max_loops;
            l_out := regexp_replace(l_out,'<([A-Z][A-Z0-9]*)[^>]*>(.*?)</\1>','\2',1,0,'imn');
            i := i + 1;
        end loop;
        return l_out;
    end strip_html;{code}
    The loop is there to handle nested HTML.
    Tyler Muth
    http://tylermuth.wordpress.com
    "Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book
    Edited by: Tyler on Oct 26, 2010 10:03 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • May ID isolate tables from plain text in a file?

    In a big Word file it seems necessary to isolate the tables from the rest of paragraphs.
    Unfortunately the body style applied to both is the same style.
    Have tables some formatting element to get only them?

    Yes, a new thread...
    Just we have a huge file with text and tables and need to place the tables at the end of the book. Just the tables. Plain text at the beginning.
    Import options for text surely allows to place only text (unchecking graphs)  but it is not an option to place only graphics, as far as we tried in the menu.*
    Thank you.
    *Furthermore, the Word brings the same style applied to tables and text... Book has to be managed in two parts.

  • Problem removing html tags from the text retrived

    Hi there,
    I am using jdbc to connect the database and retriving the data. In one of the columns along with the description there are some html tags in few of the recors of that column. is there a way to retrive the text only ignoring the html tags in between. Or can i retrive and then strip off the html code in the text to display only normal text.
    example of the data retrived which are pipe seperated and one of the columns has html tags in it:
    209|The euphoria |187945-2|http://www.abc/lst.jsp?mktgChannel=I86023&sku=18791-2&siteID=qpF0HYnRugA|http://www.abc.com/assets/images/product/medium/18793-2_198.jpg|Rooftop Singers: Walk Right In | abc Music proudly presents THE FOLK YEARS, an unforgettable era in music history!<BR><BR><B>Featuring:</B><BR>
    <LI>The most complete collection of folk and folk-rock songs ever put together -- 132 classics!
    <LI>Original hits by the original artists!
    Now i need to remove the tags before displaying this on the output. Is there a simple way to do this.
    Thanks...

    Did you read the documentation of the trim() method,
    where it describes which whitespace it removes?I believe his problem is that
    "Some text here  
    <blah> 
    More text"becomes
    "Some text here  
    More text"... and he wants ...
    "Some text here
    More text"So, your problem is that your regex isn't matching whitespace as well.
    See the "Trimming Whitespace" section:
    http://www.regular-expressions.info/examples.html

Maybe you are looking for

  • Macbook Pro running slow/(crawling) after 10.9.4 update

    I paste in information on the system from EtreCheck below. The Macbook is really crawling very slowly. It may be a coincidence, but happened when I restarted after the latest software update 1st july from OSX 10.9.3 to OSX 10.9.4 Regarding How does i

  • F4IF_INT_TABLE_VALUE_REQUEST + ALV Grid

    Hi All, I have a ALV grid with 2 fields. I implemented F4 for field1 using the FM below. I get a list of values as expected when i use 'F4', however the selected value is not written back to the ALV grid field! What am i missing here?     call functi

  • Itunes not working in OS LION

    Itunes not working after OS Lion upgrade -- pls help Process:         iTunes [252] Path:            /Applications/iTunes.app/Contents/MacOS/iTunes Identifier:      com.apple.iTunes Version:         10.4 (10.4) Build Info:      iTunes-10408001~1 Code

  • Updating pdf files in iweb site

    I have a site with several pdf files linked throughout the site. These pdf's get updated regularly, and I assumed that if I replace them with a new file named the same, it would update on the website. Strangely it does not. The only way I can get the

  • Creation ofcondition records

    Dear all, What is the difference in creating condition records in COB1 with respect to MBC1, usually we use COB1 when we want the batch determination to take place in process order and we use MBC1 if we want to have batch determination during goods i