Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. plain text article versions for saving/printing?

plain text article versions for saving/printing?

Scheduled Pinned Locked Moved Site Bugs / Suggestions
questionannouncementcareer
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matthias 0
    wrote on last edited by
    #1

    Hello, great job your doing! But I've said this already once I guess. One more suggestion I have: I think it would be practical to offer a version of an article description in text format for printing / saving. Just a thought. Matthias

    C 1 Reply Last reply
    0
    • M Matthias 0

      Hello, great job your doing! But I've said this already once I guess. One more suggestion I have: I think it would be practical to offer a version of an article description in text format for printing / saving. Just a thought. Matthias

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #2

      I've already added a "View Printable version" tag in each article (see the bottom right hand corner of article headers). If anyone knows a quick and easy way to filter out HTML tags to produce plain text then part two of your suggestion is easy. - Chris

      M E 2 Replies Last reply
      0
      • C Chris Maunder

        I've already added a "View Printable version" tag in each article (see the bottom right hand corner of article headers). If anyone knows a quick and easy way to filter out HTML tags to produce plain text then part two of your suggestion is easy. - Chris

        M Offline
        M Offline
        Mike Dunn
        wrote on last edited by
        #3

        To strip out HTML tags, off the top of my head... perl -p -e 's/<\/?[a-z]+.*?>//goi' I'm a newbie Perl programmer, so please debug this before putting it into production. ;)

        C 1 Reply Last reply
        0
        • C Chris Maunder

          I've already added a "View Printable version" tag in each article (see the bottom right hand corner of article headers). If anyone knows a quick and easy way to filter out HTML tags to produce plain text then part two of your suggestion is easy. - Chris

          E Offline
          E Offline
          Erik Thompson
          wrote on last edited by
          #4

          Hmm... The DOM does that for us, why create a needless server side program or use Perl? hmm. I'd attach a sample file if I could, but I guess I can just type it in here. <SCRIPT langauge="javaScript"> function WithoutTags() { var wnd = window.open(""); wnd.document.all(3).innerText = window.document.all.withtags.innerText; } </SCRIPT> <SPAN ID="withtags"> <IMG SRC="http://www.codeproject.com/images/cplogo.gif"> <BR> <B>Hello</B> <BR>Would you like to see more? <BR> <FONT COLOR="RED">This is more colored text in tags</FONT> </SPAN> <BR> <INPUT TYPE="BUTTON" VALUE="View Without Tags" onclick="return WithoutTags();"> I have tested this and it works. just don't F5 in the new window and you are safe. Then file/saveas and save as a text file. Done, no server hit and it's painless to do in the client. -Erik

          1 Reply Last reply
          0
          • M Mike Dunn

            To strip out HTML tags, off the top of my head... perl -p -e 's/<\/?[a-z]+.*?>//goi' I'm a newbie Perl programmer, so please debug this before putting it into production. ;)

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            Stripping tags is easy - it's the formatted text output that is the trick. For instance, <h1>Heading</h1>This is a paragraph Should come out:   Heading   This is a paragraph but by stripping tags we'd get   Heading This is a paragraph I'll check out the DOM as per Eriks suggestion

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups