WordPress.org

Ready to get started?Download WordPress

Forums

Better Anchor Links
[resolved] Can it work with with id= in the tags? (5 posts)

  1. bounder
    Member
    Posted 1 year ago #

    I have a lot of legacy content that uses eg <h2 id="Values_in_Higher_Education">

    can I alter the regex in mwm-aal-class.php to ignore the ID and list these headings too?

    http://wordpress.org/plugins/better-anchor-links/

  2. bounder
    Member
    Posted 1 year ago #

    changing line 63 from

    $pattern='#<h(['.$this->options['is_headHi'].'-'.$this->options['is_headLo'].'])>(.+?)</h\1>#is';

    to

    $pattern='#<h(['.$this->options['is_headHi'].'-'.$this->options['is_headLo'].'])(?: [^>]+)?>(.+?)</h\1>#is';

    works well.

  3. bounder
    Member
    Posted 1 year ago #

    Have resolved this, but it might be worth adding to the plugin?

  4. elpresidento
    Member
    Plugin Author

    Posted 1 year ago #

    I would rather use this my code:
    $pattern='#<h(['.$this->options['is_headHi'].'-'.$this->options['is_headLo'].'])(?: id=.+?)?>(.+?)</h\1>#is';
    but your code is compatible with others global html attributes. I will test your code. Thanks

  5. elpresidento
    Member
    Plugin Author

    Posted 1 year ago #

    Added to v 1.5.6

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.