well...i think i will ask here before I leave this extension development.
one issue, all works fine except for this error:
actual code:
export default function () {
const regex = /#(\w*[0-9a-zA-Z]+\w*[0-9a-zA-Z])/g;
const p = this.$('.Post-body');
const baseurl = app.forum.attribute('baseUrl');
p.html = p.html(
p.html().replace(regex, (match) => `<a href="${baseurl}/?q=${match.slice(1)}" class="hasht" title="Search this hashtag into Flarum">${match}</a>`)
);
}
index.js
app.initializers.add('justoverclock/flarum-ext-hashtag', () => {
extend(CommentPost.prototype, ['oncreate', 'onupdate'], ReplaceHashTag);
});
so, if one of u can help me, i will keep my time to improve this extension (there's auto completion on my todo list)
actually if u refresh the page, all becomes normal...