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. JSON data in code blocks - lang="json" doesn't work.

JSON data in code blocks - lang="json" doesn't work.

Scheduled Pinned Locked Moved Site Bugs / Suggestions
javascriptxmljsonhelpannouncement
3 Posts 2 Posters 4 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.
  • OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #1

    Chris, I have small problem with an article I'm writing to do with code blocks. I want to include the same data in CSV, JSON, and XML format, but when I use <pre lang="json"> as my block tag, the preview shows it with JavaScript instead ... The code looks fine in source view: The good news is that if I paste the CSV and JSON blocks here they show badly as well!

    policyID,statecode,county,eq_site_limit,hu_site_limit,fl_site_limit,fr_site_limit,tiv_2011,tiv_2012,eq_site_deductible,hu_site_deductible,fl_site_deductible,fr_site_deductible,point_latitude,point_longitude,line,construction,point_granularity
    119736,FL,CLAY COUNTY,498960,498960,498960,498960,498960,792148.9,0,9979.2,0,0,30.102261,-81.711777,Residential,Masonry,1
    448094,FL,CLAY COUNTY,1322376.3,1322376.3,1322376.3,1322376.3,1322376.3,1438163.57,0,0,0,0,30.063936,-81.707664,Residential,Masonry,3
    206893,FL,CLAY COUNTY,190724.4,190724.4,190724.4,190724.4,190724.4,192476.78,0,0,0,0,30.089579,-81.700455,Residential,Wood,1

    [
    {
    "policyID": 119736,
    "statecode": "FL",
    "county": "CLAY COUNTY",
    "eq_site_limit": 498960,
    "hu_site_limit": 498960,
    "fl_site_limit": 498960,
    "fr_site_limit": 498960,
    "tiv_2011": 498960,
    "tiv_2012": 792148.9,
    "eq_site_deductible": 0,
    "hu_site_deductible": 9979.2,
    "fl_site_deductible": 0,
    "fr_site_deductible": 0,
    "point_latitude": 30.102261,
    "point_longitude": -81.711777,
    "line": "Residential",
    "construction": "Masonry",
    "point_granularity": 1
    },
    {
    "policyID": 448094,
    "statecode": "FL",
    "county": "CLAY COUNTY",
    "eq_site_limit": 1322376.3,
    "hu_site_limit": 1322376.3,
    "fl_site_limit": 1322376.3,
    "fr_site_limit": 1322376.3,
    "tiv_2011": 1322376.3,
    "tiv_2012": 1438163.57,
    "eq_site_deductible": 0,
    "hu_site_deductible&

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    C 1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      Chris, I have small problem with an article I'm writing to do with code blocks. I want to include the same data in CSV, JSON, and XML format, but when I use <pre lang="json"> as my block tag, the preview shows it with JavaScript instead ... The code looks fine in source view: The good news is that if I paste the CSV and JSON blocks here they show badly as well!

      policyID,statecode,county,eq_site_limit,hu_site_limit,fl_site_limit,fr_site_limit,tiv_2011,tiv_2012,eq_site_deductible,hu_site_deductible,fl_site_deductible,fr_site_deductible,point_latitude,point_longitude,line,construction,point_granularity
      119736,FL,CLAY COUNTY,498960,498960,498960,498960,498960,792148.9,0,9979.2,0,0,30.102261,-81.711777,Residential,Masonry,1
      448094,FL,CLAY COUNTY,1322376.3,1322376.3,1322376.3,1322376.3,1322376.3,1438163.57,0,0,0,0,30.063936,-81.707664,Residential,Masonry,3
      206893,FL,CLAY COUNTY,190724.4,190724.4,190724.4,190724.4,190724.4,192476.78,0,0,0,0,30.089579,-81.700455,Residential,Wood,1

      [
      {
      "policyID": 119736,
      "statecode": "FL",
      "county": "CLAY COUNTY",
      "eq_site_limit": 498960,
      "hu_site_limit": 498960,
      "fl_site_limit": 498960,
      "fr_site_limit": 498960,
      "tiv_2011": 498960,
      "tiv_2012": 792148.9,
      "eq_site_deductible": 0,
      "hu_site_deductible": 9979.2,
      "fl_site_deductible": 0,
      "fr_site_deductible": 0,
      "point_latitude": 30.102261,
      "point_longitude": -81.711777,
      "line": "Residential",
      "construction": "Masonry",
      "point_granularity": 1
      },
      {
      "policyID": 448094,
      "statecode": "FL",
      "county": "CLAY COUNTY",
      "eq_site_limit": 1322376.3,
      "hu_site_limit": 1322376.3,
      "fl_site_limit": 1322376.3,
      "fr_site_limit": 1322376.3,
      "tiv_2011": 1322376.3,
      "tiv_2012": 1438163.57,
      "eq_site_deductible": 0,
      "hu_site_deductible&

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

      All fixed.

      cheers Chris Maunder

      OriginalGriffO 1 Reply Last reply
      0
      • C Chris Maunder

        All fixed.

        cheers Chris Maunder

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Perfect! Cheers mate! :thumbsup:

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        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