var curBlock = roam42.smartBlocks.activeWorkflow.startingBlockContents;
var newBlock = curBlock.replace('](','^tmp1^').replace('))','^tmp2^');
var newBlock = newBlock.split('(').join('%28').split(')').join('%29');
var newBlock = newBlock.replace('^tmp1^','](').replace('^tmp2^','%29)');
document.activeElement.value = '';
return newBlock.trim();
%>
π Describe the SmartBlock
One problem in Roam is that many Wikipedia links, such as for TV shows, break and donβt get parsed properly as URLs. The trick is to use % codes for ( and ) within the URL.
This SmartBlock will replace the ( and ) in a link so that it renders properly in Roam.
β Describe any prerequisites or dependencies that are required for this SmartBlock
roam42 is all you need
π· Screenshot of your 42SmartBlock workflow/template from Roam
π‘ Additional Info
This shows an example:
I Also created a find-replace SmartBlock which can help do the same thing. Here is the link to that: #118
βοΈ Copy of your 42SmartBlock from Roam
var curBlock = roam42.smartBlocks.activeWorkflow.startingBlockContents; var newBlock = curBlock.replace('](','^tmp1^').replace('))','^tmp2^'); var newBlock = newBlock.split('(').join('%28').split(')').join('%29'); var newBlock = newBlock.replace('^tmp1^','](').replace('^tmp2^','%29)'); document.activeElement.value = ''; return newBlock.trim();
π Describe the SmartBlock
One problem in Roam is that many Wikipedia links, such as for TV shows, break and donβt get parsed properly as URLs. The trick is to use % codes for ( and ) within the URL.
This SmartBlock will replace the ( and ) in a link so that it renders properly in Roam.
β Describe any prerequisites or dependencies that are required for this SmartBlock
roam42 is all you need
π· Screenshot of your 42SmartBlock workflow/template from Roam
π‘ Additional Info
This shows an example:
I Also created a find-replace SmartBlock which can help do the same thing. Here is the link to that: #118
[label_example]