But since the 2014 protests known as the Umbrella Movement, in which thousands of Hong Kong residents filled the streets to call for greater democracy, Mr. Xi’s China has grown more willing to intervene. Revelations in 2016 about Chinese agents’ earlier abduction and detention of five Hong Kong-based publishers of critical and often salacious books about Chinese leaders seemed a death knell to Hong Kong’s free speech.

Lam Wing-kee, one of the five, who said he was held in solitary confinement for five months and pressured into a public confession, is now planning to reopen his bookshop, which had been in Hong Kong until he shut it down, in Taiwan.

“We Hong Kong people look to Taiwan for lessons,” Mr. Lam said. “And people in Taiwan look to see how the Chinese mainland controls Hong Kong.”

The growing recognition of Taiwan as one of Asia’s freest environments for expression is itself a dramatic change. Until 1987, the island was under brutal martial law, controlled by the dictator Chiang Kai-shek, who had fled the Communist takeover of mainland China in 1949, and later his son.

Taiwan’s freedoms were hard-won. Last Saturday, Taiwan marked Freedom of Speech Day on the 29th anniversary of the death of the free-speech advocate Deng Nan-jung, who burned himself to death as the police prepared to storm his office and arrest him for publishing a revised constitution.

Mr. Deng’s death prompted large protests that helped set the island toward democratic government and greater freedoms.

Cédric Alviani, the Taipei bureau director of Reporters Without Borders, said Taiwan has since become an “island of stability” in a region where press freedoms were backsliding. “Freedom of expression is a big part of Taiwanese culture,” he said.