User:RobLa-WMF/preblock

Bug T132006 edit

This is the pre-block identified in Phab:T132006

Attempted HTML to copy:

class ReallyClassyCode {  public function taptaptap();  public function isthisthingon();  public function hello();

...and what I hoped to see:

class ReallyClassyCode {
  public function taptaptap();
  public function isthisthingon();
  public function hello();

(or even better, the syntax highlighting too)

Another example edit

Pre-block cut-n-paste test (text from Phab:T107595):

Level I: RevisionContentLookup edit

For accessing the content of the different slots of a revision, a RevisionContentLookup service is defined:

interface RevisionContentLookup {    function getRevisionSlot( Title $title, $revisionId, $slot = 'main' ): RevisionSlot; } class RevisionSlot {  public function getPageId();  public function getRevisionId();  public function getSlotName();  public function getContent(): Content;  public function getContentModel();  public function getTouched();  public function getReadRestrictions(): string[];  public function getSha1();  public function getSize(); }

For virtual slots, RevisionContentLookup::getRevisionSlot() or RevisionSlot::getContent() would generate the desired information on the fly. In general, RevisionSlot::getContent() should be considered to be potentially expensive, since it may trigger lazy loading of the content blob.

Side note: the use of Title in this interface is unfortunate. We would want somethign more light weight, like TitleValue, but with the information from the page table, most importantly the page ID. A PageEntry or PageRecord, prehaps.