Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6036457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:55:38+00:00 2026-05-23T05:55:38+00:00

I’m using PHP Markdown (version 1.0.1n, updated October 2009) to display text saved to

  • 0

I’m using PHP Markdown (version 1.0.1n, updated October 2009) to display text saved to a database in markdown format. I’m running into a strange issue where it’s tagging the last chunk of every entry as an H3. When I search the markdown.php file, though, there isn’t a single instance of H3.

Here are two pieces of text from my database:

Since its launch, major CPG brands, endemic as well as non-endemic, have flocked to retail websites to reach consumers deep in the purchase funnel through shopping media. In this session, you will hear about:

- The prioritization of shopping media for CPG brands.

- A case study of brands on Target.com on how this retailer (and others) have introduced a new channel for brand marketers to engage consumers where they are making the majority of purchase decisions: online.

- How CPG brands are leveraging real-time data from shopping media to capture consumer insights and market trends.

In this one, it is tagging the LI items correctly, but inside the final LI it’s tagging the actual text as H3.

Beyond the actual money she saves, this consumer is both empowered and psychologically gratified by getting the best value on her everyday purchases. It is essential for both marketers and retailers to focus on what motivates and activates this consumer. 

Diane Oshin will share insights on what influences her shopping behavior and then identify specific tools that activate her to buy.

In this one, the entire paragraph starting with Diane Oshin is tagged as an H3.

Here’s the really odd thing: when I do a view source, both of them are tagged correctly; it’s only when using Inspect Element that I see the H3. However, it’s obvious in the actual display that the H3 tag is being applied:

example 1
example 1

example 2
example 2

Can anyone help me out?

update

Per a comment below, I looked for instances of H tags. I found these functions, but don’t know if this is what could be causing the issue or not. They are the only place in the entire file that appears to be creating a header tag of any kind.

function doHeaders($text) {
        # Setext-style headers:
        #     Header 1
        #     ========
        #  
        #     Header 2
        #     --------
        #
        $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx',
            array(&$this, '_doHeaders_callback_setext'), $text);

        # atx-style headers:
        #   # Header 1
        #   ## Header 2
        #   ## Header 2 with closing hashes ##
        #   ...
        #   ###### Header 6
        #
        $text = preg_replace_callback('{
                ^(\#{1,6})  # $1 = string of #\'s
                [ ]*
                (.+?)       # $2 = Header text
                [ ]*
                \#*         # optional closing #\'s (not counted)
                \n+
            }xm',
            array(&$this, '_doHeaders_callback_atx'), $text);

        return $text;
    }
    function _doHeaders_callback_setext($matches) {
        # Terrible hack to check we haven't found an empty list item.
        if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
            return $matches[0];

        $level = $matches[2]{0} == '=' ? 1 : 2;
        $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
        return "\n" . $this->hashBlock($block) . "\n\n";
    }
    function _doHeaders_callback_atx($matches) {
        $level = strlen($matches[1]);
        $block = "<h$level>".$this->runSpanGamut($matches[2])."</h$level>";
        return "\n" . $this->hashBlock($block) . "\n\n";
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:55:39+00:00Added an answer on May 23, 2026 at 5:55 am

    I could not reproduce what you describe with the version you’ve been given:

    <?php
    include(__DIR__.'/php-markdown/markdown.php');
    
    
    $testText = 'Since its launch, major CPG brands, endemic as well as non-endemic, have flocked to retail websites to reach consumers deep in the purchase funnel through shopping media. In this session, you will hear about:
    
    - The prioritization of shopping media for CPG brands.
    
    - A case study of brands on Target.com on how this retailer (and others) have introduced a new channel for brand marketers to engage consumers where they are making the majority of purchase decisions: online.
    
    - How CPG brands are leveraging real-time data from shopping media to capture consumer insights and market trends.
    ';
    
    $resultText = Markdown($testText);
    
    var_dump($resultText);
    

    The output looks fairly as you might expect it

    string(649) "<p>Since its launch, major CPG brands, endemic as well as non-endemic, have flocked to retail websites to reach consumers deep in the purchase funnel through shopping media. In this session, you will hear about:</p>
    
    <ul>
    <li><p>The prioritization of shopping media for CPG brands.</p></li>
    <li><p>A case study of brands on Target.com on how this retailer (and others) have introduced a new channel for brand marketers to engage consumers where they are making the majority of purchase decisions: online.</p></li>
    <li><p>How CPG brands are leveraging real-time data from shopping media to capture consumer insights and market trends.</p></li>
    </ul>
    "
    

    I assume something else tampering the data before it get’s into the markdown parser or afterwards. But based on the data, the markdown parser does not create the <h3> tags. You must look somewhere else 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.