islamic-network / api.alquran.cloud

The AlQuran.Cloud API - https://alquran.cloud/api
GNU General Public License v3.0
226 stars 41 forks source link

Need help to remove Bismillah at beginning of every surah #5

Closed rachid-debu closed 6 years ago

rachid-debu commented 6 years ago

Hello

Working on a javascript application (using react native).

I feel it is a problem to have the Bismillah at the beginning of every verse.

If it's possible to get some help to find a workaround, would be much appreciated.

For example, i tried this : action.data[0].text = action.data[0].text.replace("بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ", "");

It is not working.

I'm running out of ideas..

Cheers

meezaan commented 6 years ago

Shukran for your question, brother.

See https://gist.github.com/meezaan/3433728ab67500263cc8c72f42930fbe for a javascript solution.

I am also considering a couple of other options to either have a v2 without the Bismillah or to allow a query parameter to strip it out (where appropriate, of course).

The above should work in the interim. I've answered this for PHP @ https://github.com/islamic-apps/alquran-api-client-php/issues/2.

I hope this helps and I'll leave the issue open until we at least have a formal decision on how to address the issue.

rachid-debu commented 6 years ago

Awesome thank you

I believe this can be closed then, that's enough for me.

Although you might wanna keep this open as a reminder for your v2 idea.. I believe it is a good idea to add another optionnal parameter.

Salam brother

P.S : By the way, if you add another parameter. Maybe we could have the data[0] (being currently the first verse) to be the Bismillah, with numberInSurah = 0. Then start normally with data[1] being the Alif Lam Mim (for example) with numberInSurah = 1.