On the morning of May 24, I watched a televised public caning of homosexuals in Aceh, Indonesia. The pair were surrounded by a jeering, hostile crowd of 2,000 onlookers apparently eager to watch the painful humiliation of two consenting adults who had harmed nobody.

Later that day Taiwan’s Council of Grand Justices ruled that it is unconstitutional for the country to deny individuals of the same gender the right to get married. This landmark ruling paves the way for same-sex marriage, but as Jason Hsu, a Kuomintang legislator who has been involved in promoting an amendment to the civil code in favor of marriage equality, told me, “Time is running out for Taiwan, as the elections are slowly approaching. Since the legalization of same-sex marriage is still an uncertainty, it requires immediate action.”

Taiwan remains, alas, an exception in a region blighted by bigotry and intolerance of diversity. William Yang, a Taipei-based journalist and gay activist, asserts, “With today’s ruling, Taiwan successfully cements its reputation as the ‘LGBTQ Capital in Asia’ and a beacon of progressive values, after several countries in the region witnessed increased persecutions of the LGBTQ community.”

While many Taiwanese are celebrating this victory for human rights and the dignity of an oppressed minority, there is still a ways to go before this laudable goal is actually realized. It is a remarkable ruling, however, that has dramatically increased pressure on the legislature to act. And even if the Legislative Yuan fails to act by the end of May 2019, respected Taiwan-based blogger Michael Turton says, “Gay marriage will be a reality. Couples will simply be able to walk in and register a marriage irrespective of gender. But room for compromise mischief remains.”

He adds, “This verdict will redound to Taiwan’s credit wherever people long to build loving, human-centered societies.”

But not everyone is happy with the ruling. An Apple Daily poll after the ruling found that 56 percent of the respondents were opposed to the ruling, 34 percent were supportive, and 10 percent had no opinion. However, according to Gwen Wang, a political consultant in Taipei and doctoral student at Warwick University in the U.K., the results may be skewed because this was a land-line telephone survey that probably did not capture many younger Taiwanese, who rely on mobile phones. A 2015 poll by the Ministry of Justice found that 71 percent of Taiwanese supported marriage equality, while a survey conducted by Trend Survey and Research on behalf of the opposition Kuomintang reported 51.7 percent of respondents as supporting the legalization of same-sex marriage, while 43.3 percent disapproved.

Wang explains that there are geographical, religious and generational fault-lines dividing Taiwan, as southerners and Christians (the latter comprising 5 percent of the island’s population of 23 million) have mobilized against gay rights. She says, “Taiwanese society is still quite divided over the marriage equality issue, particularly between the millennials and the baby boomers.”

In her view, the “decision made by the Constitutional Court will inevitably increase the pressure on the legislature, including those anti-marriage equality legislators whose constituencies are mostly in the traditionally more conservative southern Taiwan.” She says many people in Taiwan want “to prove to the world that they are progressive and like other Western democracies, while differentiating themselves from China, the homogenous Asian power.”

Nevertheless, “discussions on substantial issues — such as can same-sex couples adopt children or enjoy the exact same rights as heterosexual couples — are going to increase the tension between the millennials and boomers in Taiwan.”

Turton laments that the foreign media misrepresents the divide in Taiwan by describing “these yammerheads as ‘traditionalists,’ but there is nothing traditional about their position on gayness and gay marriage, both of which were traditional in Chinese history.” He adds, ” Our current anti-gay marriage culture is an aberration of the last couple of centuries, and the anti-gay marriage authoritarian Christianity driving much of the vocal objections here is a post-Enlightenment phenomenon.”

Yang points out that the Legislative Yuan has two other major draft bills under consideration involving pension reform and a major infrastructure investment program that will complicate efforts to approve the existing draft bill on marriage equality. But unless the ruling Democratic Progressive Party acts on this bill, he warns that it risks “losing the support of younger and liberal voters” with the 2018 elections looming.

Nobody seems certain when the marriage equality law will be passed — perhaps by the end of the year — but much depends on President Tsai Ing-wen’s priorities. After the ruling she tweeted, “The law must protect the people’s freedom of marriage and right to equality.” Fine sentiments, but will she exercise leadership to make this happen?

Elsewhere in Asia, persecution of the LGBTQ community is not abating. Back in 2015, Indonesia’s most powerful organization of Islamic legal scholars issued a fatwa against homosexuals and transgender people, demanding that those who engage in “deviant” acts with members of the same sex should face the death penalty.

Last month saw the first public flogging of gay men in Aceh; they each were sentenced to 85 lashes, minus two for the two months they had spent in jail. Subsequently, there was a raid in Jakarta, Indonesia’s capital, where police rounded up 141 men who were attending a gay party at a fitness club and sauna. At the police station they were paraded naked and photographed by the police, photos that were later disseminated on social media. Ironically, the men will be charged under pornography laws.

Over in Bangladesh, in April 2016 two LGBTQ bloggers were hacked to death by machete in front of one of their mothers. This May, police arrested 27 men at a community center near Dhaka on suspicion of being gay. If convicted of sodomy, they could be sentenced to life imprisonment, but it is more likely they will be prosecuted for drug possession. With the rise of Islamists, and a government eager to appease them, the LGBTQ community in Bangladesh fears the accelerating erosion of secularism.

All across Asia, LGBTQ people remain marginalized and subject to discrimination, abuse and worse, surrounding the beacon of hope in Taiwan with an abiding darkness. And, Yang reminds us, even “Taiwan has a long way to go before becoming a truly LGBTQ-friendly country.”

Jeff Kingston is the director of Asian Studies, Temple University Japan.