Skip to content
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

Fix Manganato search #218

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joao-salomao
Copy link

This PR fixes two bugs.

  1. Wrong base URL template
    Wrong: https://chapmanganato.com/https://manganato.com/search/story/%s
    Correct: https://manganato.com/search/story/%s
  2. After digging a bit on the website I found that the JS function below is being used to parse the user searches before sending the request to the server, so I implemented the same logic here too so we get the same results
function change_alias(alias) {
    var str = alias;
    str= str.toLowerCase(); 
    str= str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a"); 
    str= str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e"); 
    str= str.replace(/ì|í|ị|ỉ|ĩ/g,"i"); 
    str= str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o"); 
    str= str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u"); 
    str= str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y"); 
    str= str.replace(/đ/g,"d");
    str= str.replace(/ /g,"_");
    str= str.replace(/[^0-9a-z\s]/gi, '_');
    str= str.replace(/_+_/g,"_");
    str= str.replace(/^\_+|\_+$/g,""); 
    return str;
}

JS function location on the website
image

Telmo added a commit to Telmo/mangal that referenced this pull request Dec 19, 2024
@rd6260
Copy link

rd6260 commented Dec 21, 2024

Hey @joao-salomao I hope you're doing well. I just wanted to ask, if mangal still working? cause its not showing any results for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants