coolreader18

un mir zaynen ale shvester

known compiler nerd. jewish, ws71. i'm a maintainer of RustPython (bit less active though cause of ✨burnout✨) and i like open source and rust in general


coolreader18
@coolreader18

oh wait if cohost allows arbitrary html does that mean i can actually use my terminal emulator's "Copy as HTML" feature?

1196   β”‚     fn build_closure(&mut self, code: &CodeObject) -> bool {
1197   β”‚         if code.freevars.is_empty() {
1198   β”‚             return false;
1199   β”‚         }
1200   β”‚         for var in &*code.freevars {
1201   β”‚             let table = self.symbol_table_stack.last().unwrap();
1202   β”‚             let symbol = table.lookup(var).unwrap_or_else(|| {
1203   β”‚                 panic!(
1204   β”‚                     "couldn't look up var {} in {} in {}",
1205   β”‚                     var, code.obj_name, self.source_path
1206   β”‚                 )
1207   β”‚             });
1208   β”‚             let parent_code = self.code_stack.last().unwrap();
1209   β”‚             let vars = match symbol.scope {
1210   β”‚                 SymbolScope::Free => &parent_code.freevar_cache,
1211   β”‚                 SymbolScope::Cell => &parent_code.cellvar_cache,
1212   β”‚                 _ if symbol.is_free_class => &parent_code.freevar_cache,
1213   β”‚                 x => unreachable!(
1214   β”‚                     "var {} in a {:?} should be free or cell but it's {:?}",
1215   β”‚                     var, table.typ, x
1216   β”‚                 ),
1217   β”‚             };
1218   β”‚             let mut idx = vars.get_index_of(var).unwrap();
1219   β”‚             if let SymbolScope::Free = symbol.scope {
1220   β”‚                 idx += parent_code.cellvar_cache.len();
1221   β”‚             }
1222   β”‚             self.emit(Instruction::LoadClosure(idx as u32))
1223   β”‚         }
1224   β”‚         self.emit(Instruction::BuildTuple {
1225   β”‚             size: code.freevars.len() as u32,
1226   β”‚             unpack: false,
1227   β”‚         });
1228   β”‚         true
1229   β”‚     }

awww.

For reference, that was a bunch of <font color="#abcdef"> tags inside a <pre> tag, but cohost stripped them just leaving the text. that should be allowed I feel.... but I can do some processing to it to turn them into <span style=""> probably


coolreader18
@coolreader18

yes.... YES...

rustpython on ξ‚  main [$] is πŸ“¦ v0.1.2 via 🐍 v3.10.8 via πŸ¦€ v1.65.0 
❯ clippaste | sd '<font color="' '<span style="color:' | sd '</font' '</span' | clipcopy

rustpython on ξ‚  main [$] is πŸ“¦ v0.1.2 via 🐍 v3.10.8 via πŸ¦€ v1.65.0 
❯ 

was gonna do something with actual html dom manipulation but that's too haurd... and this should work on well-formed html anyway so


You must log in to comment.