question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing option to disable title

See original GitHub issue

Hello,

I was wondering how I could disable the title of an generated icon ? I can’t find an option to disable the auto generating of a title.

My icons are constructed like below. The title “toevoegen” is only active when you over over a part of the icon that has no content. Else the title “add_circle” is displayed.

<a href="/customer-service/patients/new/" title="Toevoegen">
  <svg class="icon " }}="">
      <use xlink:href="/dist/sprites.svg#add_circle"></use>
  </svg>
</a>

I have changed this in my npm folder. This seems to be working well. Mind you this is my first time I changed a npm package.

function SVGSpritemapPlugin(options) {
    // Merge specified options with default options
    this.options = merge({
        src: '**/*.svg',
        svgo: {},
        glob: {},
        prefix: 'sprite-',
        gutter: 2,
        filename: 'spritemap.svg',
        chunk: 'spritemap',
        deleteChunk: true,
        svg4everybody: false,
        generateTitle: true                   <--- Added 
    }, options, {
        svgo: {
            plugins: [{
                cleanupIDs: false
            }]
        }
    });
}
// Generate a title or not ?
if( options.generateTitle == true ) {    <--- Added 
  // Make sure we don't overwrite the existing title
  var hasTitle = false;
  for ( var i = 0; i < svg.childNodes.length; i++ ) {
    if ( svg.childNodes[i].tagName && svg.childNodes[i].tagName.toLowerCase() === 'title' ) {
      var hasTitle = true;
    }
  }

  // Add title for improved accessibility
  if ( !hasTitle ) {
      var title = XMLDoc.createElement('title');
      title.appendChild(XMLDoc.createTextNode(id.replace(options.prefix, '')));
      symbol.appendChild(title);
  }
}   

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
Hoetcommented, May 18, 2018

Correct, I’m forced to use 1.x for now. To many things need to change in this project to be able to use 2.x. And seeing I have only 2 weeks left in this project I’m not going to touch that 😉

Alright, I’ll do that.

0reactions
cascornelissencommented, May 27, 2018

Version 1.2.0 and 2.5.0 containing this feature have just been released and published to npm.

Thanks for your contribution, @Hoet! 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hide Title option missing - WordPress.org
I need the title of every page hidden. But the problem is not with the site but with the plugin. The plugin used...
Read more >
How to Disable Title on Posts, Pages, or Other Post Types?
This can be a great solution if you want to disable titles on all posts, pages, or other post types. You can add...
Read more >
How to Hide Page and Post Titles in WordPress - Kinsta
Follow these few easy steps to hide titles in single posts, pages, ... There may be no easy “hide title” option built into...
Read more >
How to Hide Page Title in WordPress: Manual Method + Plugins
Hover over the page of your choice, then over Edit. Don't click it.
Read more >
Where has the option to disable "title bar window shake" gone to
61 votes, 18 comments. 420K subscribers in the Windows10 community. Welcome to the largest community for Microsoft Windows 10, the world's ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found