I have been able to change each node's Comment Link 'title' text (that on default renders 'Add new comment') with the below code, but if I add HTML, it renders as plain text. I'm trying to add a FontAwesome icon before this text <i class="fa fa-comments" aria-hidden="true"></i>
function MODULE_node_view_alter(&$build) {
$node = $build['#node'];
if (isset($build['links']['comment']['#links']['comment-add'])) {
$build['links']['comment']['#links']['comment-add']['title'] = '<i class="fa fa-comments" aria-hidden="true"></i> Add Comment';
}
}
All I have passed is a $build parameter, but I am unsure of whether or not this is the issue.
Any ideas?