-
Notifications
You must be signed in to change notification settings - Fork 8
Remove unnecessary hash from tags when creating new question (post) #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
forum/qa-content/qa-ask.js
Outdated
| // filter tags, accept only those without # and those like "C#" | ||
| var filteredTags = allTags.filter(function(hash) | ||
| { | ||
| if (hash.indexOf('#') < 0 || hash.toLowerCase().indexOf('c#') > -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to put omitting languages in array.
What do you think?
we have C# F# ..
https://en.wikipedia.org/wiki/List_of_programming_languages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efiku
Hmm.., I assumed that users will not search (and mark as tags) languages with "#" character, because there are any categories on forum for languages other than C# - except I forgot about category "Inne języki". Ok then, there may be questions and tags that contains languages with "#" other than mentioned C#.
I have looked on Your linked Wiki and what I saw is mostly 10 per 11 languages has "#" as second character, excluding "Visual J#" - which, on the other hand, I can't find was searched on Forum (so it can be almost sure, that nobody asks about that language).
Considering that fact and recalling KISSprinciple ( ;-) ) I propose to accept only tags, that have not any "#" or have it positioned as a second character in single tag. So for example these tags:
f# programming# newbie c# h#hash after filtering will be saved as f# newbie c# h#hash within this simple algorithm: return hash.indexOf('#') < 0 || hash.indexOf('#') === 1.
I only hope nobody put tags like "o#pomocy" :)
I hope You will agree with that solution.
I let myself pushed my proposal for Your suggestion: e4493f5
|
According to what @awaluk mentioned and @efiku noticed, I did flitering only on # when they are on 0 position inside each tag, so:
will be eventually saved as:
Additionally, I rewrote code to ES6 syntax. Recent code: https://github.com/CodersCommunity/forum.pasja-informatyki.local/pull/31/files |
|
In my opinion now it works well. |
|
As for @magic96 advice I swapped IIFE to ES6 standalone block code (using advantage of ES6 |
Like this? → #34 (comment) |
|
@efiku Temporary solution is that You and everybody who want to test recent PRs, need to add this: What about rebase. As I'am newbie to Git, I wait for @awaluk to do that rebase (so I will not crash some code accidentaly). |
NO. We are working on dev not prod development. I'm checking every PR like this #34 (comment) |
|
@CodersCommunity/users |
|
Please rebase and allow us to test with latest master branch state. |
According to: https://trello.com/c/qJ8rbIeo/33-usuwanie-znaku-z-tagow
Here is a script that removes unnecessary hash symbols "#" (ommiting values like "C#") from tags written inside
<input id="tags">when user is creating a new post (asking a question).