When importing icons whose names contain underscores (e.g. my_icon) these underscores get converted to dashes when displaying the i-tag (e.g. ). You can define these names in icomoon, but I think the issue is rather connected with the Icon API module?

The css of the font still has the class defined as .my_icon - that results in the icon to not be displayed.

Comments

markhalliwell’s picture

Title: Icons with underscores in their names are not displayed » Icon classes generally sanitized. Add specific provider hook
Related issues: +#2200673: Handling of Spaces and Capitization in Icon Names

The problem lies in icon_preprocess_icon_sprite():

  // Sanitize and add icon class here. Don't need to check for numeric because
  // these are already CSS class name based.
  $variables['attributes']['class'][] = drupal_html_class($icon);

We need to create a hook so providers can override this if necessary (see related issue), as it's too controlling for some (icomoon).